05-28-2008, 09:59 AM
The following code uses print using to print 1234.5 as $1,234.50
in the print using command:
$$ means put a dollar sign in front
# means print a digit so four means print four digits
, before the dot means put a comma every 3 spaces
. means put the decimal point here
if you made the code
it would output the same but would also work if x = 12345678.5 where the first example wouldn't.
hope that helped
LPG
Code:
cls
x = 1234.5
print using "$$####,.##";x
in the print using command:
$$ means put a dollar sign in front
# means print a digit so four means print four digits
, before the dot means put a comma every 3 spaces
. means put the decimal point here
if you made the code
Code:
cls
x = 1234.5
print using "$$########,.##
it would output the same but would also work if x = 12345678.5 where the first example wouldn't.
hope that helped
LPG
WHILE RPG$ <> "complete" : make up silly excuses :WEND