Skip to content

Flurrywinde/japanese-numbers-converter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

japanese-number-converter

Converts Japanese kanji numerals into full-width numerals and arabic numbers.

Based on kitagawa-hr/japanese-number-converter which is based on twada/japanese-numerals-to-number.

Usage

Original Usage

import jnc

assert jnc.ja_to_arabic("九千七兆千九百九十二億五千四百七十四万九百九十一") == 9007199254740991

For detail, see test cases.

My modifications

Ignore non-numerals mode

assert jnc.ja_to_arabic("亜県水戸郡余市東町十二線四号", ignore_non_numerals=True) == "亜県水戸郡余市東町12線4号"

Output full-width numerals

assert jnc.ja_to_arabic("亜県水戸郡余市東町十二線四号", ignore_non_numerals=True, full_width_output=True) == "亜県水戸郡余市東町12線4号"
Note

Output in the original usage is of type int, but with my modifications, it's str.

Installation

pip install "git+https://github.com/Flurrywinde/japanese-numbers-converter.git"

Supported formats

numbers 0 to 9

  • , , , , , , , , ,

names of powers of 10

  • , , , , ,
  • , , ,

About

japanese numbers converter with no dependencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%