Method: ConverterBase#kanji_num_to_integer
- Defined in:
- lib/converterbase.rb
#kanji_num_to_integer(string) ⇒ Object
188 189 190 191 192 193 194 |
# File 'lib/converterbase.rb', line 188 def kanji_num_to_integer(string) total = 0 string.scan(/([#{KANJI_NUM}十百千]+)([万億兆京]*)/) do |num, units| total += (__calc_kanji_num_with_unit(num).to_s + units.each_char.map { |c| "0" * KANJI_NUM_UNITS_DIGIT[c] }.join).to_i end total end |