DECFLOAT to decimal
When a DECFLOAT value is assigned to a decimal column or variable, the DECFLOAT value is converted, if necessary, to the precision and the scale of the target.
During the assignment, the necessary number of leading zeros is added and, in the fractional part of the number, the necessary number of trailing zeros is added, or rounding occurs.
For static SQL statements other than CREATE VIEW, the ROUNDING bind option or the native SQL procedure option determines the rounding mode.
For dynamic SQL statements (and static CREATE VIEW statements), the special register CURRENT DECFLOAT ROUNDING MODE determines the rounding mode.
Example 1: The following example shows decimal floating-point
numbers converted to a decimal value:
Decimal floating-point number: Results when assigned to an decimal(15,0)
column or host variable:
2.0000045E6 2000005
Decimal floating-point number: Results when assigned to an decimal(15,2)
column or host variable:
2.0000045E6 2000004.50
2.00000555E8 200000555.00