Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.3.12, 5.5.36, 10.0.9
-
None
-
None
Description
For a double type argument,
ROUND(1e0, N) returns N fractional digits when N is <31,
and 0 fractional digits when N is >=31.
+--------------+----------------------------------+---------------+----------------+
|
| ROUND(1e0,5) | ROUND(1e0,30) | ROUND(1e0,31) | ROUND(1e0,100) |
|
+--------------+----------------------------------+---------------+----------------+
|
| 1.00000 | 1.000000000000000000000000000000 | 1 | 1 |
|
+--------------+----------------------------------+---------------+----------------+
|
For a decimal type argument ROUND(1.0,N) works differently:
+--------------+----------------------------------+----------------------------------+----------------------------------+
|
| ROUND(1.0,5) | ROUND(1.0,30) | ROUND(1.0,31) | ROUND(1.0,100) |
|
+--------------+----------------------------------+----------------------------------+----------------------------------+
|
| 1.00000 | 1.000000000000000000000000000000 | 1.000000000000000000000000000000 | 1.000000000000000000000000000000 |
|
+--------------+----------------------------------+----------------------------------+----------------------------------+
|
It returns N fractional digits for N<31, and 30 fractional digits for N>=31.
Not sure which is more correct, but it would be nice to have
similar behaviour for the two data types.