floor source npm

_.floor(number, [precision=0])

Calculates number rounded down to precision.

Arguments

  1. number (number)

    The number to round down.

  2. [precision=0] (number)

    The precision to round down to.

Returns (number)

Returns the rounded down number.

Example

_.floor(4.006);
// => 4

_.floor(0.046, 2);
// => 0.04

_.floor(4060, -2);
// => 4000