Fixed #119 -- Explicitly set decimal rounding mode

This commit is contained in:
Raphael Michel
2016-02-11 17:27:11 +01:00
parent 417539d101
commit 0741c00133
4 changed files with 13 additions and 4 deletions

View File

@@ -3,6 +3,8 @@ import tempfile
import time
from decimal import Decimal
from pretix.base.decimal import round_decimal
def hbci_transactions(event, conf):
try:
@@ -92,7 +94,7 @@ def hbci_transactions(event, conf):
num = int(parts[0])
denom = int(parts[1])
value = Decimal(num) / Decimal(denom)
value = str(value.quantize(Decimal('.01')))
value = str(round_decimal(value))
data.append({
'payer': "\n".join(payer),
'reference': trans.find('purpose').find('value').text,