Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Rounding numbers

by Khen1950fx (Canon)
on Mar 27, 2014 at 13:02 UTC ( #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
Node Status?
node history
Node Type: note [id://1079914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2019-05-26 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (152 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!