Closed mociepka closed 6 years ago
https://github.com/mirumee/prices/blob/master/prices/__init__.py#L350
I propose to add quantize=True to apply arguments in discounts and if it is True does quantization but not with hard coded value.
quantize=True
True
In some countries tere are zero decimal places in others can be three of them. I have function for qunatize already:
from babel.core import get_global def get_quantize_value_for_currency(currency): fractions = get_global('currency_fractions') try: digits_number = fractions[currency][0] except KeyError: digits_number = fractions['DEFAULT'][0] return Decimal(10) ** -digits_number
https://github.com/mirumee/prices/blob/master/prices/__init__.py#L350
I propose to add
quantize=True
to apply arguments in discounts and if it isTrue
does quantization but not with hard coded value.In some countries tere are zero decimal places in others can be three of them. I have function for qunatize already: