projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Version 1
[yaffs-website]
/
node_modules
/
underscore.string
/
toNumber.js
diff --git a/node_modules/underscore.string/toNumber.js
b/node_modules/underscore.string/toNumber.js
new file mode 100644
(file)
index 0000000..
92d47dd
--- /dev/null
+++ b/
node_modules/underscore.string/toNumber.js
@@ -0,0
+1,5
@@
+module.exports = function toNumber(num, precision) {
+ if (num == null) return 0;
+ var factor = Math.pow(10, isFinite(precision) ? precision : 0);
+ return Math.round(num * factor) / factor;
+};