Every line of 'js round up' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
4 function round(v, n) { 5 return +(Math.round(v + 'e+' + n) + 'e-' + n); 6 }
57 export function round (n, decimals = 0) { 58 return Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); 59 }
32 function round2(number) { 33 return Math.round(number * 100) / 100; 34 }
5 export function round( 6 n: number, 7 precision: number = defaultPrecision, 8 ): number { 9 return +n.toFixed(precision) 10 }
185 function round2(n) { 186 return Math.round(n * 100) / 100; 187 }
33 round() { 34 return new _ExactMath(arguments, 'round')._rounding(); 35 }
590 function round(num, precision) { 591 return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); 592 }
83 function round(val){return val.toFixed(6);}
162 export function myRound (v, digits = 2) { 163 var p = Math.pow(10, digits) 164 return Math.round(v * p) / p 165 }
131 export function round(value: number, decimals: number = 0): number 132 { 133 return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals); 134 }