goslows said:Does anyone have the answer to change the format of a decimal to a string with leading zeros and cents showing? Example: I wish to display 120.25 in 10 spaces to look like 0000012025. Any help would be much appreciated!
DEFINE VARIABLE f$dec AS DECIMAL NO-UNDO.
DEFINE VARIABLE i$dec AS INTEGER NO-UNDO.
ASSIGN f$dec = 120.25
i$dec = f$dec * 100.
DISP STRING(i$dec,"9999999999") FORMAT "X(10)".
goslows said:Does anyone have the answer to change the format of a decimal to a string with leading zeros and cents showing? Example: I wish to display 120.25 in 10 spaces to look like 0000012025. Any help would be much appreciated!
bendaluz2 said:Try this
Code:DEFINE VARIABLE f$dec AS DECIMAL NO-UNDO. DEFINE VARIABLE i$dec AS INTEGER NO-UNDO. ASSIGN f$dec = 120.25 i$dec = f$dec * 100. DISP STRING(i$dec,"9999999999") FORMAT "X(10)".