"1 months", eww
authorMark Wells <mark@freeside.biz>
Tue, 8 Sep 2015 00:40:25 +0000 (17:40 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 8 Sep 2015 00:40:25 +0000 (17:40 -0700)
FS/FS/discount.pm

index 361e0b4..e113357 100644 (file)
@@ -196,7 +196,13 @@ sub description {
 
   ( my $months = $self->months ) =~ s/\.0+$//;
   $months =~ s/(\.\d*[1-9])0+$/$1/;
-  $desc .= " for $months months" if $months;
+  if ($months) {
+    if ($months == 1) {
+      $desc .= " for 1 month";
+    } else {
+      $desc .= " for $months months";
+    }
+  }
 
   $desc .= ', applies to setup' if $self->setup;