MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / round

Function round

src/fire.js:134–143  ·  view source on GitHub ↗
(n, dec)

Source from the content-addressed store, hash-verified

132};
133
134var round = function(n, dec) {
135 n = parseFloat(n);
136 if(!isNaN(n)){
137 if(!dec) var dec= 0;
138 var factor= Math.pow(10,dec);
139 return Math.floor(n*factor+((n*factor*10)%10>=5?1:0))/factor;
140 } else {
141 return n;
142 }
143};
144
145var createScriptTable = function(ts) {
146 if (ts == undefined) ts = '';

Callers 1

createScriptItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…