Apr 4, 2006
Rounding in Javascript
function round(num, decimalPlaces) {
n = Math.pow(10, decimalPlaces);
return Math.round(num * n) / n;
}
Apr 4, 2006
function round(num, decimalPlaces) {
n = Math.pow(10, decimalPlaces);
return Math.round(num * n) / n;
}