Icon ROUND

Rounds a number to a specified number of decimal places.

Syntax
ROUND(<NumericExpression> [TO <IntegerExpression>])
ROUND(<NumericExpression> [, <IntegerExpression>])

<NumericExpression> =

Type of:

SMALLINT
INTEGER|INT
BIGINT
FLOAT
DECIMAL|NUMERIC

<IntegerExpression> =

Type of:

SMALLINT
INTEGER|INT
BIGINT

Returns
Same as input

Usage
The ROUND function rounds a numeric value to a specified number of decimal places. The number of decimal places is optional, and if not specified the value returned will be rounded to 0 decimal places.

Information The ROUND function performs "normal" rounding where the number is rounded up if the fractional portion beyond the number of decimal places being rounded to is greater than or equal to 5 and down if the fractional portion is less than 5. Also, if using the ROUND function with DOUBLE PRECISION or FLOAT values, it is possible to encounter rounding errors due to the nature of floating-point values and their inability to accurately express certain fractional real numbers.

Examples
SELECT SUM(ROUND(Distance TO 2)) AS ApproxDistance
FROM Destinations

SQL 2003 Standard Deviations
This function deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis function is an ElevateDB extension.
Image