Category: Number function
This function rounds number down to the nearest integer - or full, non-fractional number - towards negative infinity.
Argument | Type | Description |
---|---|---|
number | Number | The value, usually fractional, to be rounded. |
Return value type: Number
If the argument provided has any decimal portion, the whole number will be rounded down (towards negative infinity) to the next nearest whole number.
floor(10.0001) //Returns 10
floor(10.5) //Returns 10
floor(10.9999) //Returns 10
floor(-10.0001) //Returns -11 (Rounded down towards negative infinity)
floor(-10.5) //Returns -11 (Rounded down towards negative infinity)
floor(-10.9999) //Returns -11 (Rounded down towards negative infinity)