Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Number.roundToStep

roundToStep($stepInterval) -> number

Description

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

$num = 18
$num.roundToStep(5)    //= 15

$num = 345
$num.roundToStep(100)  //= 300

$num = 3.8
$num.roundToStep(0.5)  //= 3.5

$num = -23
$num.roundToStep(10)   //= -30

See Also