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