Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by tangent (Priest)
on Mar 29, 2012 at 17:14 UTC ( #962446=note: print w/replies, xml ) Need Help??


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

I have worked around this problem by doing this before calling printf:
$number += 0.001 if $number =~ m/\.\d{2}5$/;
  • Comment on Re^2: Answer: 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
Node Status?
node history
Node Type: note [id://962446]
help
Chatterbox?
[Corion]: Most likely Regexp::Debugger uses something in main:: ;)
[Corion]: Hmm - no, nothing jumps out immediately
Corion jumps into bed
[choroba]: On the indicated line, it uses (caller 1)10
[choroba]: (caller 1)[10] that is

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-09-25 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (291 votes). Check out past polls.

    Notices?