use sprintf to round

This commit is contained in:
Yanick Champoux 2023-08-26 12:19:43 -04:00
parent 07da0d91a5
commit 1200d98323

View File

@ -72,9 +72,7 @@ sub generate_output_table ($ts) {
# create hash with each computer and its average GHz Days per day # create hash with each computer and its average GHz Days per day
my %ranks = pairmap { my %ranks = pairmap {
my $mean = sum( @$b ) / @$b; $a => sprintf "%.0f", sum(@$b)/@$b;
my $rounded = int( $mean + 0.5 );
$a => $rounded;
} %$list; } %$list;
# sort hash by the average and print to screen # sort hash by the average and print to screen