SQL DIGITS scalar function in DB2 for i SQL |
DIGITS
The DIGITS function returns a absolute value character string of a number.
Syntax
DIGITS(numeric-expression)
The argument should be an expression that returns a value that is a SMALLINT, INTEGER, BIGINT, or DECIMAL built-in numeric data type. The result does not include a sign or a decimal point. The result can be null if argument is null.
Example
SELECT digits(-554546.40) FROM sysibm.sysdummy1
Output:
DIGITS 55454640
Here, the output does not contain sign as provided in the argument and it does contain leading zero in the output even after decimal places.