develooper Front page | perl.beginners | Postings from February 2002

Number Truncation/Rounding

Thread Next
From:
Balint, Jess
Date:
February 13, 2002 10:28
Subject:
Number Truncation/Rounding
Message ID:
CA8ED43817EFD211855E00805FE6FD7403AA19B5@scadmail2.alldata.net
Hello all. I have a script that uses alot of data and calculates a
cumulative percent of this data. That cumulative percent should be 100.00 at
the end. What I get is:

99.9999999999998

I need to truncate this to 2 decimal places and hopefully round it to
100.00. Thanks in advance.

--Jess

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About