Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: How do I round a number?

( #179893=categorized answer: print w/ replies, xml ) Need Help??

Q&A > math > How do I round a number? 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'.

Comment on Answer: How do I round a number?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-29 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls