Rounding in Javascript
function round(num, decimalPlaces) {
n = Math.pow(10, decimalPlaces);
return Math.round(num * n) / n;
}
About this entry
You’re currently reading “ Rounding in Javascript ,” an entry on bluebones.net
- Published:
- 2006.04.04
- Category:
- Programming
No comments
Jump to comment form | comments rss [?] | trackback uri [?]