Money.new(-1000, "EUR") |> Money.to_string() # "-€10.00", new behavior, correct
Money.new(-1000, "EUR") |> Money.to_string(minus_sign_first: false) # "-€10.00", option is ignored
After PR:
Money.new(-1000, "EUR") |> Money.to_string() # "-€10.00", still correct
Money.new(-1000, "EUR") |> Money.to_string(minus_sign_first: false) # "€-10.00", option is now being respected
Why
A previous PR - https://github.com/elixirmoney/money/pull/173 - changed how negative values are rendered, and added an option called minus_sign_first to the documentation. That flag was being ignored.
This change updates Money.to_string to use that flag, so that users can optionally get backwards compatibility with older versions of Money.
What
Before PR:
After PR:
Why
A previous PR - https://github.com/elixirmoney/money/pull/173 - changed how negative values are rendered, and added an option called
minus_sign_first
to the documentation. That flag was being ignored.This change updates
Money.to_string
to use that flag, so that users can optionally get backwards compatibility with older versions of Money.