Rounds the first argument to the nearest multiple of the second argument, or to the nearest integer when the second argument is omitted.
Category: | Truncation |
Returned data type: | DOUBLE |
specifies any valid expression that evaluates to a numeric value, to be rounded.
Data type | DOUBLE |
See | <sql-expression> |
FedSQL Expressions |
specifies a positive numeric expression that specifies the rounding unit.
Data type | DOUBLE |
See | <sql-expression> |
FedSQL Expressions |
ROUND(0.33,0.1)
, ROUND returns 0.3
and not 3*0.1.
ROUND(expression,
rounding-unit)
produces the result that you expect from
decimal arithmetic if the result has no more than nine significant
digits and any of the following conditions are true:
select round(1234.56789,100); Result: 1200 select round(1234.56789,10); Result: 1230 select round(1234.56789,1); Result: 1235 select round(1234.56789,.1); Result: 1234.6 select round(1234.56789,.01); Result: 1234.57 select round(1234.56789,.001); Result: 1234.568 select round(1234.56789,.0001); Result: 1234.5679 select round(1234.56789,.00001); Result: 1234.56789 select round(1234.56789,.1111); Result: 1234.5432 select round(1234.56789,.11111); Result: 1234.54321
select round(1234.56789,.11111) - 11111*.11111;
Statement
|
Result
|
---|---|
select round(9.5,10); |
10 |