Permalink
Browse files

avoid dividing by 0

  • Loading branch information...
1 parent 109eea1 commit 7a4ef4f9d159abc84e0f0cdbb53e3d979755fe8e Luke Closs committed Mar 7, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Biopay/Transaction.pm
@@ -111,5 +111,6 @@ method _build_total_taxes {
}
method _build_tax_rate {
+ return 0 if $self->price == 0;
sprintf '%0.01f', $self->total_taxes / $self->price * 100;
}

0 comments on commit 7a4ef4f

Please sign in to comment.