Skip to content

round

Rounds a number or a time/duration with a specified unit.

round(x:number)
round(x:time, unit:duration)
round(x:duration, unit:duration)

The round function rounds a number x to an integer.

For time and duration values, use the second unit argument to define the rounding unit.

from {
x: round(3.4),
y: round(3.5),
z: round(-3.4),
}
{
x: 3,
y: 4,
z: -3,
}
from {
x: round(2024-08-23, 1y),
y: round(42m, 1h)
}
{
x: 2025-01-01,
y: 1h,
}

ceil, floor