LoginSignup
2
2

More than 5 years have passed since last update.

Pythonのモジュールnum2words 英語とロシア語の挙動の違い

Posted at

Pythonのモジュールnum2words 英語とロシア語の挙動の違い

num2words version 0.5.5
Mac OS X 10.12.6

from num2words import num2words
print(num2words(int(10), lang='ru'))  # десять → 10
print(num2words(float(10), lang='ru')) # десять запятая ноль → 10.0

print(num2words(int(10)))  # ten → 10
print(num2words(float(10))) # ten → 10

ロシア語では、.0となる場合それを表現してくれるようです。
英語では、.0となる場合は無いものとみなすようです。

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