The DECFLOAT function returns a decimal floating-point representation of a number or a string representation of a number.
Numeric to DECFLOAT
.-,--34-. >>---DECFLOAT----(--numeric-expression--+-------+--)----------->< '-,--16-'
String to DECFLOAT
>>---DECFLOAT---------------------------------------------------> .-,--34-. >--(--string-expression--+-------+--+----------------------+--)->< '-,--16-' '-,--decimal-character-'
The
default is 34.The result is the same number that would occur if the first argument were assigned to a decimal floating-point column or variable.
folded
to uppercase
must conform to the rules for forming
a floating-point, decimal floating-point, integer, or decimal constant.
The
default is 34.The result is the same number that would result from CAST(string-expression AS DECFLOAT(34)) or CAST(string-expression AS DECFLOAT(16)).
The result of the function is a DECFLOAT number with the specified (either implicitly or explicitly) number of digits of precision. If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.
If necessary, the source is rounded to the precision of the target. See CURRENT DECFLOAT ROUNDING MODE for more information.
Syntax alternatives: The CAST specification should be used to increase the portability of applications. For more information, see CAST specification.
SELECT EMPNO, DECFLOAT(EDLEVEL,16) FROM EMPLOYEE