swap Money for MoneyAmount, fix a couple of things along the way

This commit is contained in:
Pablo Martin 2024-06-27 17:18:43 +02:00
parent ab2ac1ec6a
commit 0947b34ebf
6 changed files with 26 additions and 27 deletions

View file

@ -3,9 +3,12 @@ from typing import Union
from money.currency import Currency
from xexe.constants import DEFAULT_MAX_DECIMALS
DEFAULT_MONEY_PRECISION = DEFAULT_MAX_DECIMALS
DEFAULT_MONEY_PRECISION_POSITIONS = 8
DEFAULT_MONEY_PRECISION = Decimal(
"0." + ("0" * (DEFAULT_MONEY_PRECISION_POSITIONS - 1)) + "1"
)
# If we have X decimal positions, we want 7 zeros and 1 one
# i.e. 0. 000 000 01
class MoneyAmount: