diff options
Diffstat (limited to 'type/money.py')
| -rw-r--r-- | type/money.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/type/money.py b/type/money.py index d7e6ffa..39557aa 100644 --- a/type/money.py +++ b/type/money.py @@ -60,7 +60,8 @@ class Money(object): raise TypeError('In strict_mode only two moneys can be added') else: return Money( - amount=self.amount + Decimal(float(other)), currency=self.currency + amount=self.amount + Decimal(float(other)), + currency=self.currency, ) def __sub__(self, other): @@ -74,7 +75,8 @@ class Money(object): raise TypeError('In strict_mode only two moneys can be added') else: return Money( - amount=self.amount - Decimal(float(other)), currency=self.currency + amount=self.amount - Decimal(float(other)), + currency=self.currency, ) def __mul__(self, other): @@ -82,7 +84,8 @@ class Money(object): raise TypeError('can not multiply monetary quantities') else: return Money( - amount=self.amount * Decimal(float(other)), currency=self.currency + amount=self.amount * Decimal(float(other)), + currency=self.currency, ) def __truediv__(self, other): @@ -90,7 +93,8 @@ class Money(object): raise TypeError('can not divide monetary quantities') else: return Money( - amount=self.amount / Decimal(float(other)), currency=self.currency + amount=self.amount / Decimal(float(other)), + currency=self.currency, ) def __float__(self): @@ -119,7 +123,8 @@ class Money(object): raise TypeError('In strict_mode only two moneys can be added') else: return Money( - amount=Decimal(float(other)) - self.amount, currency=self.currency + amount=Decimal(float(other)) - self.amount, + currency=self.currency, ) __rmul__ = __mul__ |
