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

Math.roundStep

Math.roundStep($n, $interval)

Description

Round $n down (i.e. left on the number line) to the nearest multiple of $interval.

Math.roundStep(18, 5);     //= 15
Math.roundStep(345, 100);  //= 300
Math.roundStep(3.8, 0.5);  //= 3.5
Math.roundStep(-23,  10);  //= -30