UNPKG
inline-assets
Version:
latest (1.5.1)
1.5.1
1.5.0
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
Inline External Assets of HTML/CSS Files
github.com/rse/node-inline-assets
rse/node-inline-assets
inline-assets
/
sample
/
node_modules
/
underscore.string
/
toNumber.js
6 lines
(5 loc)
•
195 B
JavaScript
View Raw
1
2
3
4
5
6
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; };