Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Answer: How do I round a number?

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

Q&A > math > How do I round a number? contributed by buckaduck

For scientific applications requiring the use of significant figures ("sig figs"), I strongly recommend the Math::SigFigs module. Unfortunately, the CPAN testers still haven't cleared it for Windows clients, though...
use Math::SigFigs; print FormatSigFigs($number, $digits);

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 chilling in the Monastery: (13)
As of 2014-09-18 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls