Skip to content

ceil

ceil

🔢 Number

Round 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).

  • If number is null, returns null
  • ceil(3.0) returns 3 (already an integer)
  • ceil(3.1) returns 4
  • ceil(-2.9) returns -2 (rounds toward positive infinity, not toward zero)
  • ceil(0) returns 0
| 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.

  • eval — to create or transform numeric fields