Node.js examples for Math:Round
Round Number to
Number.prototype.roundTo = function(num) { var resto = this%num; if (resto <= (num/2)) { return this-resto; } else {// w ww. j av a 2 s .c o m return this+num-resto; } };