Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 perusing the Monastery: (5)
As of 2014-10-26 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (151 votes), past polls