Skip to main content

Easy converter between Kanji-Number and Integer

Project description

Easy converter between Kanji-Number and Integer

Powered by Yamato Nagata

GitHub

Can Convert Number up to 10 ** 72 - 1

from kanjize import number2kanji, kanji2number, Number, KanjizeConfiguration, KanjizeZero, KanjizeStyle

print(number2kanji(58076099))
    # 五千八百七万六千九十九

print(number2kanji(58076099, config=KanjizeConfiguration(use_daiji=True)))
    # 伍阡捌佰漆萬陸阡玖拾玖

print(kanji2number("五千八百七万六千九十九"))
    # 58076099

print(kanji2number("223兆4千億4256万6千"))
    # 223400042566000

print(kanji2number("223兆4000億4256万6000"))
    # 223400042566000

print(number2kanji(223400042566000, config=KanjizeConfiguration(style=KanjizeStyle.MIXED, kanji_thousand=False)))
    # 223兆4000億4256万6000

print(number2kanji(223400042566000, config=KanjizeConfiguration(style=KanjizeStyle.MIXED)))
    # 223兆4千億4256万6千

print(number2kanji(20301, config=KanjizeConfiguration(style=KanjizeStyle.FLAT)))
    # 二〇三〇一

print(number2kanji(20301, config=KanjizeConfiguration(style=KanjizeStyle.FLAT, zero=KanjizeZero.KANJI)))
    # 二零三零一

print(number2kanji(0))
    # 零

print(number2kanji(0, config=KanjizeConfiguration(zero=KanjizeZero.SIGN)))
    # 〇

print((Number.from_kanji("223兆4千億4256万6千") * Number(2.3)).to_kanji(config=KanjizeConfiguration(style=KanjizeStyle.MIXED)))
    # 446兆8千億8513万2千

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kanjize-1.5.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

kanjize-1.5.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file kanjize-1.5.0.tar.gz.

File metadata

  • Download URL: kanjize-1.5.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for kanjize-1.5.0.tar.gz
Algorithm Hash digest
SHA256 130c4ac37971a1d823412e11edf16a0786e6982ea374d85f82f0fb07bf8aa962
MD5 d0025cc77967022da657c4a9529eabeb
BLAKE2b-256 2a095fae81740436c97f555631837aed9a1fb0d230f82e8d376f10934770b047

See more details on using hashes here.

File details

Details for the file kanjize-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: kanjize-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for kanjize-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a1539d25949ff7e025faa0ddb001938e904cf49d9e85acd4c6260b2bc6afb4d
MD5 5669b9ad3e43d4a14997562b80559070
BLAKE2b-256 b4aa9e1c487c6815a4e0b134ea84fe917b4ea43f4de6e08dc06c1cb59e6f1386

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page