PayPal: Fix support for CLP

This commit is contained in:
Raphael Michel
2018-04-11 13:03:01 +02:00
parent 4f636b7cfb
commit c9f9668e52
2 changed files with 36 additions and 7 deletions

View File

@@ -3,9 +3,9 @@ from decimal import ROUND_HALF_UP, Decimal
from django.conf import settings
def round_decimal(dec, currency=None):
def round_decimal(dec, currency=None, places_dict=settings.CURRENCY_PLACES):
if currency:
places = settings.CURRENCY_PLACES.get(currency, 2)
places = places_dict.get(currency, 2)
return Decimal(dec).quantize(
Decimal('1') / 10 ** places, ROUND_HALF_UP
)