Improve percentage output.

This commit is contained in:
Bradley M. Kuhn 2014-04-03 18:56:49 -04:00
parent 6012f6e78e
commit ac1db134a3

View file

@ -124,7 +124,9 @@ print sprintf("%.2f", $percent), "% ($countDeleted/$total) ",
sprintf("were deleted.\nThis leaves %d in the folder.\n",
$total - $countDeleted));
print sprintf("Of those matching the date range, %.2f", $percent), "% ($countDeleted/$totalInDate) ",
my $percentInDate = ($totalInDate / $total) * 100.00;
print sprintf("Of those matching the date range, %.2f", $percentInDate), "% ($countDeleted/$totalInDate) ",
((defined $COUNT_ONLY and $COUNT_ONLY) ?
" would be deleted.\n" :
sprintf("were deleted.\n"));