floor
floor(val: numeric, [precision: const int64]?) -> float64
Computes the floor of numeric val at a configurable decimal scale. By default the value is rounded down to an integer int64 result; with a positive precision constant the result is a float64 value retaining fractional digits at that scale. A null val propagates as null. See also round and ceil, which share the same optional precision argument.
The precision argument is an optional compile-time constant in [-18, 18] that defaults to 0. Values <= 0 produce an int64; values > 0 produce a float64 with the given number of fractional digits.
Domain
This is a scalar function (calculates a single output value for a single input row).
Categories
Examples
make_col buckets:floor(@.latency_ms / 10)
Floors the ratio of latency to a fixed step so values fall into coarse integer bucket labels for grouping.
make_col whole_units:floor(@.quantity, 0)
Demonstrates the default precision of zero, discarding positive fractional quantity toward negative infinity.
Updated 18 days ago