Formatting String Numbers

qeyfexa

New Member
I have a variable defined as zzzz,zzz,zz9.99 I need to convert that to a string in order to write it out to a word document. When I do that I lose the commas and decimal point. How can I format the sting to show the commas and decimal point?
 

ajaysheth

Member
Hi,

Try the code below;

Code

def var wkint as decimal format "zzz,zzz,zzz,zz9.99".
def var wkchar as char format "X(18)".
set wkint.
wkchar = string(wkint,"zzz,zzz,zzz,zz9.99").
output to "test.doc".
put wkchar.
output close.

HTH,
Rgds,
Ajay.


 
Top