Skip to content

round

round

🔢 Number

Round to the nearest integer (half rounds up)

round(number) → number
number

The input rounded to the nearest integer; null if input is null

The round function rounds the input number to the nearest integer.

  • If number is null, returns null
  • round(3.0) returns 3 (already an integer)
  • round(3.5) returns 4 (rounds half up)
  • round(3.4) returns 3
  • round(-2.5) returns -2 (rounds half up toward positive infinity)
  • round(0) returns 0
| eval rounded_duration = round(duration_ms / 1000)

Rounds duration in milliseconds to the nearest second.

| eval percentile_rounded = round(percentile)

Rounds a percentile value to the nearest integer.

| stats avg(round(latency_ms))

Calculates average latency with each value rounded first.

  • eval — to create or transform numeric fields