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
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?