Node.js examples for Math:Round
Rounding a Number to x Decimal Places
// Rounding a Number to x Decimal Places function roundTo(base, precision) { var m = Math.pow(10, precision); var a = Math.round(base * m) / m; return a;/*from ww w . j a v a 2s .c o m*/ }