From ac1db134a33ad2628b44869cb6599c6f9c42366d Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Thu, 3 Apr 2014 18:56:49 -0400 Subject: [PATCH] Improve percentage output. --- remove-spam-high-confidence-maildir.plx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remove-spam-high-confidence-maildir.plx b/remove-spam-high-confidence-maildir.plx index 6e49a22..b78960f 100755 --- a/remove-spam-high-confidence-maildir.plx +++ b/remove-spam-high-confidence-maildir.plx @@ -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"));