Skip to content

Commit

Permalink
Fixed precision when converting amount convert_money
Browse files Browse the repository at this point in the history
  • Loading branch information
synasius committed Oct 17, 2013
1 parent 9e26fe5 commit 12472b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djmoney_rates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ def convert_money(amount, currency_from, currency_to):
currency_to, source.name))

if isinstance(amount, float):
amount = Decimal(amount).quantize(rate_from)
amount = Decimal(amount).quantize(Decimal('.000001'))

return (amount / rate_from) * rate_to

0 comments on commit 12472b6

Please sign in to comment.