Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 musing on the Monastery: (8)
As of 2020-05-25 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (145 votes). Check out past polls.

    Notices?