Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How do I print/round a number to a given number of decimal places?

by hossman (Prior)
on May 30, 2003 at 06:39 UTC ( [id://261776]=note: print w/replies, xml ) Need Help??


in reply to How do I print/round a number to a given number of decimal places?

As in How do I round a number?Math::Round has a great method for this:

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

  • Comment on Re: How do I print/round a number to a given number of decimal places?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://261776]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (None)
    As of 2024-04-25 01:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found