X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=e5fc089c4cf66d45a7da4d48d0d557ef591a1bba;hb=8a0204b4a129a3c26dcca18ba401b2de26d22d2b;hp=402730d3f9dd658b650ae87722af034d9bb3cda7;hpb=4cacb3fa439b56fc7c9a742b69ec3f6ffd660433;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 402730d3f..e5fc089c4 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -188,15 +188,17 @@ sub calc_discount { die "error discounting: $error" if $error; $amount *= $months; + $amount = sprintf('%.2f', $amount); #add details on discount to invoice my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; + $months = sprintf('%.2f', $months) if $months =~ /\./; my $d = 'Includes '; $d .= $discount->name. ' ' if $discount->name; $d .= 'discount of '. $discount->description_short; - $d .= " for $months month". ( $months>1 ? 's' : '' ); + $d .= " for $months month". ( $months!=1 ? 's' : '' ); $d .= ": $money_char$amount" if $months != 1 || $discount->percent; push @$details, $d;