Open thai-truong opened 5 months ago
Currently, there is an existing bug in monetize v1.13.0 ..
Does this bug only affect the Malaysian ringgit (MYR) or are other currencies affected? Thanks.
Currently, there is an existing bug in monetize v1.13.0 ..
Does this bug only affect the Malaysian ringgit (MYR) or are other currencies affected? Thanks.
This affects any currency that is not in Monetize::Parser::CURRENCY_SYMBOLS.values
, according to this line in the code.
I've personally run into the aforementioned issue with Malaysian Ringgit (as "RM", not "MYR") and Australian Dollar (AUD) since neither of them are in Monetize::Parser::CURRENCY_SYMBOLS.values
.
Monetize::Parser::CURRENCY_SYMBOLS
's main purpose seems to be to map non-ISO currency symbols to their respective ISO-4217 currency code. That's why I think it is unsuitable to be used in the manner implemented in https://github.com/RubyMoney/monetize/pull/167
What do you think? And thanks for taking a look!
Currently, there is an existing bug in
monetize
v1.13.0 introduced by https://github.com/RubyMoney/monetize/pull/167 that attempted to implement additional logic for currency parsing discussed in https://github.com/RubyMoney/monetize/issues/153.Example of the bug:
[8] pry(main)> "RM100".to_money => #
[14] pry(main)> Monetize.parse("100 RM") => #