ceil
ceil
🔢 NumberRound up to the nearest integer (toward positive infinity)
ceil(number) → number number The smallest integer greater than or equal to the input; null if input is null
The ceil function rounds the input number up to the nearest integer (ceiling function).
Edge Cases
Section titled “Edge Cases”- If
numberisnull, returnsnull ceil(3.0)returns3(already an integer)ceil(3.1)returns4ceil(-2.9)returns-2(rounds toward positive infinity, not toward zero)ceil(0)returns0
Examples
Section titled “Examples”| eval min_pages = ceil(total_bytes / page_size)
Calculates minimum number of pages needed to store a file.
| eval rounded_duration = ceil(duration_ms / 1000)
Rounds up duration in milliseconds to the nearest second.
| stats sum(ceil(cost))
Calculates total cost with each item rounded up.
Used In
Section titled “Used In”eval— to create or transform numeric fields