Project

numeja

0.0
No commit activity in last 3 years
No release in over 3 years
Parse numbers in japanese numerals from String.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Numeja Gem Version Build Status Code Climate Coverage Status

Parse numbers in japanese numerals from String

漢数字とかをInteger or Floatに変換するGem

Installation

Add this line to your application's Gemfile:

gem 'numeja'

And then execute:

$ bundle

Or install it yourself as:

$ gem install numeja

Usage

require 'numeja'

Numeja.numerize('二千三百八十一億九千四百八十七万六千三百十一') # =>  238_194_876_311
Numeja.numerize('弐阡參佰捌拾壱億九千四百八十七万六千三百十一') # =>  238_194_876_311
Numeja.numerize('9876億5432万1千2百3十4') # => 987_654_321_234)
Numeja.numerize('9876億5432万1千2百3十4') # => 987_654_321_234
Numeja.numerize('玖阡捌陌漆拾陸億伍仟肆佰參十貳万壹千弐百卅4') # => 987_654_321_234
Numeja.numerize('505') #  => 505
Numeja.numerize('九八七六五四三二一零') # => 9_876_543_210
Numeja.numerize('九分八厘七毛六糸五忽四微三繊二沙零塵一埃') # => 0.9876543201
Numeja.numerize('九割八分七厘六毛五糸四忽三微二繊零沙一塵') # => 0.9876543201
Numeja.numerize('二分の一') # => 0.5
Numeja.numerize('三分の一') # => 0.33333333333...