round
round
🔢 NumberRound 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.
Edge Cases
Section titled “Edge Cases”- If
numberisnull, returnsnull round(3.0)returns3(already an integer)round(3.5)returns4(rounds half up)round(3.4)returns3round(-2.5)returns-2(rounds half up toward positive infinity)round(0)returns0
Examples
Section titled “Examples”| 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.
Used In
Section titled “Used In”eval— to create or transform numeric fields