initial commit
This commit is contained in:
23
node_modules/mumath/pretty.js
generated
vendored
Normal file
23
node_modules/mumath/pretty.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Format number nicely
|
||||
*
|
||||
* @module mumath/loop
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var precision = require('./precision');
|
||||
var almost = require('almost-equal');
|
||||
var normalize = require('./normalize');
|
||||
|
||||
module.exports = function (v, prec) {
|
||||
if (almost(v, 0)) return '0';
|
||||
|
||||
if (prec == null) {
|
||||
prec = precision(v);
|
||||
prec = Math.min(prec, 20);
|
||||
}
|
||||
|
||||
// return v.toFixed(prec);
|
||||
return v.toFixed(prec);
|
||||
};
|
||||
Reference in New Issue
Block a user