summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-01-24 17:22:58 -0800
committerMark Wells <mark@freeside.biz>2013-01-24 17:22:58 -0800
commit658a793422919736368e1f0a29b0f448ef362908 (patch)
tree4e370ced612c73765622b84f67da19541057ff0b
parent62e9ed602776893e9bc45e7b1e2bfef18c254a64 (diff)
fix floating point error in taxline, #21099
-rw-r--r--FS/FS/cust_main_county.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/cust_main_county.pm b/FS/FS/cust_main_county.pm
index 573359571..fb80809e0 100644
--- a/FS/FS/cust_main_county.pm
+++ b/FS/FS/cust_main_county.pm
@@ -512,8 +512,10 @@ sub taxline {
# now round and distribute
my $extra_cents = sprintf('%.2f', $taxable_cents * $self->tax / 100) * 100
- $tax_cents;
+ # make sure we have an integer
+ $extra_cents = sprintf('%.0f', $extra_cents);
if ( $extra_cents < 0 ) {
- die "nonsense extra_cents value $extra_cents"; # because seriously, wtf
+ die "nonsense extra_cents value $extra_cents";
}
$tax_cents += $extra_cents;
my $i = 0;