ROUND

All functions > MATH > ROUND

Returns the number rounded to the nearest integer or to a specified number of decimal places.

Signatures

Returns: Rounded number

ROUND(number: T, [decimal_places: BIGINT]) → DOUBLE
sql
ParameterTypeRequiredDescription
numberTYesThe number to round
decimal_placesBIGINTNoOptional number of decimal places (default: 0)

Notes

  • Uses "round half up" strategy (0.5 rounds up to 1)
  • Negative decimal_places rounds to tens, hundreds, etc.
  • ROUND(123.456, 2) = 123.46
  • ROUND(123.456, -1) = 120.0
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ROUND(2.4e0),  -- Round down below 0.5
    f2 := ROUND(2.5e0),  -- Round half up
    f3 := ROUND(2.6e0),  -- Round up above 0.5
    f4 := ROUND(-2.4e0),  -- Negative number rounds down
    f5 := ROUND(-2.6e0),  -- Negative number rounds up
    f6 := ROUND(123.456e0, 2)  -- Round to 2 decimal places
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHARf5 VARCHARf6 VARCHAR
2.03.03.0-2.0-3.0123.46

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19