File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Current
4+ - Fix parsing multiple delimeters in the amount, after BigDecimal updates
5+
36## 1.13.0
47- ** Breaking change** : check ISO currency code validity when parsing strings with ` to_money `
58- Adds ` expect_whole_subunits ` option when fractional subunits are expected
Original file line number Diff line number Diff line change @@ -10,4 +10,8 @@ elsif RUBY_VERSION =~ /^1/
1010 gem 'i18n' , '~> 0.9'
1111end
1212
13+ if RUBY_VERSION >= '3.4.0'
14+ gem 'bigdecimal'
15+ end
16+
1317gemspec
Original file line number Diff line number Diff line change @@ -184,8 +184,10 @@ def regex_safe_symbols
184184 end
185185
186186 def split_major_minor ( num , delimiter )
187- major , minor = num . split ( delimiter )
188- [ major , minor || '00' ]
187+ splits = num . split ( delimiter )
188+ fail ParseError , 'Invalid amount (multiple delimiters)' if splits . length > 2
189+
190+ [ splits [ 0 ] , splits [ 1 ] || '00' ]
189191 end
190192
191193 def currency_symbol_regex
You can’t perform that action at this time.
0 commit comments