round javascript number code example
Example 1: rounding off in javascript
var avg=10.55;
console.log(Math.round(avg)); //Prints 11
Example 2: round down the number javascript
+3.5 => +3.0
-3.5 => -4.0
+3.5 => +3.0 using Math.floor()
-3.5 => -3.0 using Math.ceil()