Skip to content

Commit

Permalink
When base converting, only return Decimal with two points.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzenderman committed Dec 3, 2013
1 parent 78974ac commit 7487775
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion djmoney_rates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def base_convert_money(amount, currency_from, currency_to):
if isinstance(amount, float):
amount = Decimal(amount).quantize(Decimal('.000001'))

return (amount / rate_from) * rate_to
# After finishing the operation, quantize down final amount to two points.
return ((amount / rate_from) * rate_to).quantize(Decimal("1.00"))


def convert_money(amount, currency_from, currency_to):
Expand Down

0 comments on commit 7487775

Please sign in to comment.