ROUND Function [Numeric]

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

Syntax

ROUNDnumeric-expression, integer-expression )

Parameters

Parameter

Description

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.

Returns

NUMERIC

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

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.

Related reference
TRUNCNUM Function [Numeric]