Book Contents

Book Index

Next Topic

Home

ROUND

The ROUND function rounds off a value to a specified number of decimal places. Fractions greater than or equal to .5 are rounded up. Fractions less than .5 are rounded down (truncated).

Syntax

ROUND ( expression [ , decimal-places ] )

Semantics

expression

is an expression of type DOUBLE PRECISION

decimal-places

if positive, specifies the number of decimal places to display to the right of the decimal point; if negative, specifies the number of decimal places to display to the left of the decimal point.

Notes

Examples

SELECT ROUND(3.14159, 3);

3.142

SELECT ROUND(1234567, -3);

1235000

SELECT ROUND(3.4999, -1);

0