round(val: numeric, [precision: const int64]?) -> float64

Rounds numeric val to the nearest representable value at a configurable decimal scale. By default the value is rounded to an integer int64; with a positive precision constant the result is a float64 with that many fractional digits. A null val propagates as null. Related helpers floor and ceil use the same optional precision argument.

The precision argument is an optional compile-time constant in [-18, 18] that defaults to 0. Values <= 0 yield an int64 result; values > 0 yield a float64 at the requested decimal precision.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

make_col rounded_rate:round(@.error_rate * 100, 2)

Scales an error rate to percentage points then rounds to two fractional digits for stable dashboard display.

make_col nearest_int:round(@.score)

Uses default precision so each score snaps to the nearest integer as an int64-friendly label.