home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4819 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!wupost!gumby!destroyer!caen!sdd.hp.com!mips!darwin.sura.net!jvnc.net!yale.edu!think.com!linus!philabs!crpmks!billb
  3. From: billb@crpmks.uucp (Bill Bochnik (Info Systems))
  4. Subject: Re: Rounding real #s
  5. Reply-To: billb@crpmks.UUCP (Bill Bochnik (Info Systems))
  6. Organization: Ciba-Geigy Corporation
  7. Date: Wed, 12 Aug 1992 13:41:12 GMT
  8. Message-ID: <1992Aug12.134112.4397@crpmks.uucp>
  9. Keywords: Rounding
  10. References: <164i0vINN2lo@tony.ksu.ksu.edu> <1992Aug11.082014.26260@qiclab.scn.rain.com>
  11. Lines: 24
  12.  
  13. In article <1992Aug11.082014.26260@qiclab.scn.rain.com> 70465.203@compuserve.com writes:
  14. >wmorgan@tony.ksu.ksu.edu () writes:
  15. >
  16. >>    I am a new user of TP 6.0, and would like to know how to round a
  17. >>real number to 2 decimal places, I.E. round 456.2345 to 456.23.  I am working
  18. >>on a payroll program.
  19. >
  20. >in a Write, or writeln, you just tack :x:y onto the variable. eg
  21. >    write(pay:6:2)
  22. >will print the contents of pay as a 6 place number with two places to the
  23. >left of the decimal.
  24. >-123.45
  25. > 123.45
  26. >
  27. >etc.
  28. >
  29.  
  30. Truncated, not rounded.
  31.  
  32. -- 
  33. Bill Bochnik            | It's hard to be a James Bond in an Abbott
  34. Systems Analyst         |    and Costello world.
  35. Ciba-Geigy Corporation        | Signed and sealed, they deliver oblivion.
  36. philabs!crpmks!billb        | It's worse than that, he's dead Jim.
  37.