Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Rounding numbers

by Khen1950fx (Canon)
on Mar 27, 2014 at 13:02 UTC ( [id://1079914]=note: print w/replies, xml ) Need Help??


in reply to Rounding numbers

For me, the easiest way round an average is to use Number::Format:
#!/usr/bin/perl use strict; use warnings; use Number::Format qw(round); my $total = 1000; my $counter = 3; my $average = ($total/$counter); print "Average ", round($average);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-03-28 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found