RubyMoney / monetize

A library for converting various objects into `Money` objects.
MIT License
430 stars 107 forks source link

Problem with default currency and symbol with parse! #161

Closed dawidof closed 1 year ago

dawidof commented 2 years ago
3.1.2 :032 > Monetize.assume_from_symbol = true
 => true
3.1.2 :033 > Monetize.parse!("100 zł")     <-- correct
 => #<Money fractional:10000 currency:PLN>
3.1.2 :034 > Monetize.parse!("100 zz")     <-- correct
 => #<Money fractional:10000 currency:USD>
3.1.2 :035 > Money.default_currency=nil
 => nil
3.1.2 :036 > Monetize.parse!("100 zł")     <-- not parsing
/Users/dmytro/.rvm/gems/ruby-3.1.2/gems/money-6.16.0/lib/money/currency.rb:40:in `new': Unknown currency '' (Money::Currency::UnknownCurrency)
3.1.2 :037 > Monetize.parse!("100 zz")     <-- correct
/Users/dmytro/.rvm/gems/ruby-3.1.2/gems/money-6.16.0/lib/money/currency.rb:40:in `new': Unknown currency '' (Money::Currency::UnknownCurrency)
3.1.2 :038 >
rgalanakis commented 2 years ago

Also running into this.