>>-ROUND--(--expression1--,--expression2--)--------------------><
The schema is SYSFUN.
Returns the expression1 rounded to expression2 places right of the decimal point. If expression2 is negative, expression1 is rounded to the absolute value of expression2 places to the left of the decimal point.
The first argument can be of any built-in numeric data type. The second argument can be INTEGER or SMALLINT. DECIMAL and REAL are converted to double-precision floating-point number for processing by the function.
The result of the function is:
The result can be null; if any argument is null, the result is the null value.
Example:
VALUES (DECIMAL(ROUND(873.726,2),6,3), DECIMAL(ROUND(873.726,1),6,3), DECIMAL(ROUND(873.726,0),6,3), DECIMAL(ROUND(873.726,-1),6,3), DECIMAL(ROUND(873.726,-2),6,3))
The above example returns:
1 2 3 4 5 -------- -------- -------- -------- --------- 873.730 873.700 874.000 870.000 900.000
As mentioned, the output of the ROUND function is DOUBLE. For the above example the function DECIMAL has been used to limit the output of ROUND.