floor
floor
🔢 NumberRound down to the nearest integer (toward negative infinity)
floor(number) → number number The largest integer less than or equal to the input; null if input is null
The floor function rounds the input number down to the nearest integer (floor function).
Edge Cases
Section titled “Edge Cases”- If
numberisnull, returnsnull floor(3.0)returns3(already an integer)floor(3.9)returns3floor(-2.1)returns-3(rounds toward negative infinity, not toward zero)floor(0)returns0
Examples
Section titled “Examples”| eval hours = floor(duration_seconds / 3600)
Calculates how many complete hours are in a duration.
| eval request_batch = floor(request_id / 100)
Groups requests into batches of 100.
| stats sum(floor(cost))
Calculates total cost with each item rounded down.
Used In
Section titled “Used In”eval— to create or transform numeric fields