業界トップクラスの求人数を誇る転職エージェントPR

リクルートグループのコネクションを活かした非公開求人も充実、他にはない好条件の求人と出会える

1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

めざせpythonライブラリマスター (7)numparser

Posted at

【ライブラリ説明】

 文字列を数へ変換

【プログラム】

numparser.py
# -*- coding: utf-8 -*-

import numparser

print int(numparser.numparser('one quadrillion two hundred thousands three'))
print numparser.numparser('six million four hundred thousand five')
print numparser.numparser('$410 million')
print numparser.numparser('50,000,001 to $100,000,000')
print numparser.numparser('Fifty-two Million Five HundredThousand Dollars')
print numparser.numparser('less than $5,000,000.00 (five million dollars')
print numparser.numparser('$50 million $160,000')

【結果】

 1000000000200003
 6400005.0
 410000000.0
 100000000.0
 52500000.0
 5000000.0
 50160000.0

【参考サイト】

 numparser
 github

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?