http://www.perlmonks.org?node_id=1079914


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);