Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Rounding of a number...

by steves (Curate)
on Dec 27, 2004 at 01:42 UTC ( #417500=note: print w/replies, xml ) Need Help??


in reply to Rounding of a number...

One way is to just drop the trailing digits:

my $x = $yearlyamount / 52; $x =~ s/(\.\d\d)\d*$/$1/;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://417500]
help
Chatterbox?
[Lady_Aleena]: Taking the printing functionality out of a module is hard at times. The one I'm currently working on has conditionals and loops for the data to be printed.
[Lady_Aleena]: Some are as easy as returning instead of printing, but only some.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2017-05-29 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?