DB2 Scalar functions - DECFLOAT_FORMAT
The DECFLOAT_FORMAT function returns a DECFLOAT(34) value that is based on the interpretation of the input string using the specified format.
The schema is SYSIBM.
If format-string is not specified, string-expression must conform to the rules for forming an SQL integer, decimal, floating-point, or decimal floating-point constant (SQLSTATE 22018) and have a length not greater than 42 bytes (SQLSTATE 42820).
The result is a DECFLOAT(34). If the first or second argument can be null, the result can be null; if the first or second argument is null, the result is the null value.
DECFLOAT_FORMAT( '123.45' )
DECFLOAT_FORMAT( '-123456.78' )
DECFLOAT_FORMAT( '+123456.78' )
DECFLOAT_FORMAT( '1.23E4' )
DECFLOAT_FORMAT( '123.4', '9999.99' )
DECFLOAT_FORMAT( '001,234', '000,000' )
DECFLOAT_FORMAT( '1234 ', '9999MI' )
DECFLOAT_FORMAT( '1234-', '9999MI' )
DECFLOAT_FORMAT( '+1234', 'S9999' )
DECFLOAT_FORMAT( '-1234', 'S9999' )
DECFLOAT_FORMAT( ' 1234 ', '9999PR' )
DECFLOAT_FORMAT( '<1234>', '9999PR' )
DECFLOAT_FORMAT( '$123,456.78', '$999,999.99' )