Code Monkey home page Code Monkey logo

japanese_number_to_integer's Introduction

漢数字文字列変換

漢数字文字列を整数変数に変換するPython関数です。
法令等の漢数字を変換する際にご活用ください。

壱弐参など表記にも対応しています。(例:参万)
英数字との混在にも対応しています。(例:30000百万)
桁は無量大数まで対応しています。(例:七十無量大数七百不可思議五千那由他一阿僧祇七千三百三十三恒河沙)

カンマ「,」などの区切り文字は非対応です。あらかじめ取り除いてください。

使い方

引数に漢数字文字列を指定して実行すると整数が表示されます。
importして関数を直接呼ぶことも出来ます。

コマンド例

python3 japanese_number_to_integer.py 三万五千一

結果表示

35001

コマンド例

python3 japanese_number_to_integer.py 30000百万

結果表示

30000000000

コマンド例

python3 japanese_number_to_integer.py 七十無量大数七百不可思議五千那由他一阿僧祇七千三百三十三恒河沙

結果表示

7007005000000173330000000000000000000000000000000000000000000000000000

関数使用例

from japanese_number_to_integer import japanese_number_to_integer
print(japanese_number_to_integer('三万五千一'))

結果表示

35001

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.