numerals_jp

Gem Version Build Status

A numerals library for Japanese

This library converts between Arabic numerals and Japanese numerals
which are often used(i.e., from 1 to 9,999,999,999,999,999).

Installation

Add this line to your application's Gemfile:

gem 'numerals_jp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install numerals_jp

Usage

require 'numerals_jp'

Convert from Japanese numerals

"三十六".jp_to_num
# => "36"

This method just replaces Japanese numerals with Arabic numerals.

"十二月三十一日".jp_to_num
# => "12月31日"

Convert to Japanese numerals

106.to_jp
# => "百六"

19937.to_jp
# => "一万九千九百三十七"

Roadmap

Done:

  • Support converting from integer to Japanese numerals.

Pending:

  • Support converting from Japanese numerals without factor units.
  • Support converting from Arabic numerals with Japanese factor units.

Other Integrations

Code Climate Coverage Status Inline docs

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/paralleltree/numerals_jp.

License

The gem is available as open source under the terms of the MIT License.