Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping the the zero at the end of decimals
#2
"True" numbers don't have leading  or trailing zeroes.  So, if you want to use, say,
x = 45.60, you cannot use a "number"; you have to use strings.  So, you would code the above as x$ = "45.60".

If you want to use numbers, and your results are, say, x = 45.6, you can print this out as 45.60 by two methods: either you convert it to a string with a trailing zero, say by the code,  x$ = STR$(x) + "0", which would be too straneous and very indirct, or, best by a long shot, you can use the QB PRINT USING statement.  Read up on it in the QuickBASIC 4.5 IDE by clicking on Help, then Index, then P, then on the PRINT USING statement.

Once you master that bit of code, practice it and, if you still have a problem, post back, showing the respective code, stating your expected results, and explaining any problem you are having.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Messages In This Thread
Re: Keeping the the zero at the end of decimals - by Ralph - 05-27-2008, 10:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)