14th January 2021
Rounds a number down to the next largest integer less than or equal to the given value.
value (integer) (Required): The float value you wish to round down.
Return Value(s)The number rounded down.
Examples of Math.floor()
console.log(Math.floor(2.1234)) // Output = 2
The above will output 2.
console.log(Math.floor(68.7654)) // Output = 68
The above will output 68.
Similar Functions in Other Languages
- PHP: floor()
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.