Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in converting currency #76

Closed
LostKobrakai opened this issue Aug 20, 2018 · 2 comments
Closed

Error in converting currency #76

LostKobrakai opened this issue Aug 20, 2018 · 2 comments

Comments

@LostKobrakai
Copy link
Contributor

LostKobrakai commented Aug 20, 2018

iex(8)> Money.new!(:EUR, "90")
#Money<:EUR, 90>
iex(11)> Money.to_currency(v(8), :EUR)
{:ok, #Money<:EUR, 90>}
iex(12)> Money.to_currency(v(8), "EUR")
{:ok, #Money<:EUR, 89.99999999999999999999999996>}

I'm not really sure why that's happening:

  1. The currencies are the same, so there shouldn't be any attempt in converting the amount
  2. The amount should not change with Dezimal values if I understand those correctly.

Version: 2.6.1

@LostKobrakai
Copy link
Contributor Author

That‘s just my example. I noticed it when loading the initial money value from the db (composite type in postgres).

@kipcole9
Copy link
Owner

Now published to hex as version 2.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants