ROUND function [Numeric]

Function

Rounds the numeric-expression to the specified integer-expression number of places after the decimal point.

Syntax

ROUND ( numeric-expression, integer-expression )

Parameters

numeric-expression The number, passed to the function, to be rounded.

integer-expression A positive integer specifies the number of significant digits to the right of the decimal point at which to round. A negative expression specifies the number of significant digits to the left of the decimal point at which to round.

Examples

The following statement returns the value 123.200:

SELECT ROUND( 123.234, 1 ) FROM iq_dummy

Additional results of the ROUND function are shown in the following table:

Value

ROUND (Value)

123.4567

round (a.n,4)

123.4570

round (a.n,3)

123.4600

round (a.n,2)

123.5000

round (a.n,1)

123.0000

round (a.n, 0)

120.0000

round (a.n,-1)

100.0000

round (a.n,-2)

0.0000

round(a.n,-3)

Standards and compatibility

See also

“TRUNCNUM function [Numeric]”