Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: How do I round a number?

by ryanus (Sexton)
on Jul 06, 2002 at 22:15 UTC ( #179893=categorized answer: print w/replies, xml ) Need Help??

Q&A > math > How do I round a number? - Answer contributed by ryanus

I would use Math::Round. It is easy to use. For example:

use Math::Round; print nearest(.01, 1.555);
prints '1.56'.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
NodeReaper wonders through a maze of twisty little sayings, all alike

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2017-04-23 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (431 votes). Check out past polls.