Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Math.round

Math.round($n, $precision = 0)

Description

Round $n to the specified precision (digits after the decimal point).

Half fractions are rounded up. (e.g. 1.5 = 2, -1.5 = -2)

Math.round(3.2);        //= 3
Math.round(3.5);        //= 4
Math.round(3.8);        //= 4
Math.round(1.2538, 2);  //= 1.25
Math.round(1.025, 2);   //= 1.03