JavaScript floor
Math.floor() rounds a number DOWN to the nearest integer — "floor". 4.9 becomes 4, and -4.1 becomes -5.
Syntax
Math.floor(num) Examples
| Input | Arguments | Output |
|---|---|---|
| 4.9 | — | 4 |
Try it live
Type your input and see floor transform it instantly.
Want to go further? Chain floor with other functions in the visual Playground — pipe one output into the next and watch your data transform.