Skip to content

Commit

Permalink
Merge pull request #366 from wilsonc86/patch-2
Browse files Browse the repository at this point in the history
Update ledger/checkout/utils.py calculate_excl_gst
  • Loading branch information
scottp-dpaw authored Aug 7, 2018
2 parents 4af336a + 7a0e68c commit b2ae011
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ledger/checkout/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from decimal import Decimal as D, ROUND_HALF_DOWN
from decimal import Decimal as D, getcontext

from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
Expand Down Expand Up @@ -247,7 +247,9 @@ def get_last_check(self):


def calculate_excl_gst(amount):
result = D(100.0)/ D(100 + settings.LEDGER_GST) * D(amount)
TWELVEPLACES = D(10) ** -12
getcontext().prec = 22
result = (D(100.0) / D(100 + settings.LEDGER_GST) * D(amount)).quantize(TWELVEPLACES)
return result


Expand Down

0 comments on commit b2ae011

Please sign in to comment.