Math.floor() / Math.ceil()
Rounds down / up.
Syntax
Math.floor(number) · Math.ceil(number)
Description
floor always rounds down, ceil always rounds up (regardless of the decimal).
Example
Loading editor…
Expected output
4 5
When to use?
Calculating page count, ceiling/floor limits.