elixirmoney / money

Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog.
https://hex.pm/packages/money/
MIT License
826 stars 139 forks source link

Breaking change between 1.11 and 1.12 #198

Closed michelboaventura closed 1 year ago

michelboaventura commented 1 year ago

Hi! I've found a breaking change between 1.11 to 1.12:

# 1.11
Money.parse!("6.0e3", "USD") == %Money{amount: 603, currency: :USD}

# 1.12
Money.parse!("6.0e3", "USD") == %Money{amount: 600000, currency: :USD}

So in 1.11 the e was completely ignored and now it's properly handled, which yields completely different values for the same input.

So maybe we should add a breaking change on the release logs so that other users can be prepared.

Thanks!

Nitrino commented 1 year ago

Hi @michelboaventura thanks for your report. I think you are right. I will retire this version and release a new one without this feature

Nitrino commented 1 year ago

New v1.12.1 released. Thank you for your attention

michelboaventura commented 1 year ago

Thank you for the great lib!