Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping the the zero at the end of decimals
#3
The following code uses print using to print 1234.5 as $1,234.50

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
Reply


Messages In This Thread
Re: Keeping the the zero at the end of decimals - by LPG - 05-28-2008, 09:59 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)