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

Number.roundToStep

roundToStep($stepInterval) -> number

Description

Round down (i.e. toward negative infinity) 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