floor

floor(number number) → integer result
Computes the rounded down value of given number.
The rounded up value can be computed using ceil and the closest integer using round.

Returns number rounded down to the nearest integer. You can round up with ceil, and round to the nearest integer with round.

Parameters
Return
Examples

floor(1) // 1 floor(1.8) // 1 floor(2.3) // 2 floor(3.5) // 3 floor(-12.79) // -13

See also