Simple package that converts numbers (int and float)
Project description
NUM_TO_STR_REPR
Simple package that converts numbers (int and float) to the Russian and Ukrainian string representation.
The supported number in range [-googol, googol].
Installation
Use the package manager pip to install num-to-str-repr.
pip install num-to-str-repr
Example
By default the language is Russian.
from num_to_str_repr.number_converter import NumberConverter
converter = NumberConverter()
# Int number
converter.convert(789_567_361_890_000_321)
"семьсот восемьдесят девять квадриллионов пятьсот шестьдесят семь триллионов триста шестьдесят один миллиард восемьсот девяносто миллионов триста двадцать один"
# Float number
converter.convert(534.321)
"пятьсот тридцать четыре целых триста двадцать одна тысячная"
from num_to_str_repr.number_converter import NumberConverter
converter = NumberConverter("UA")
# Int number
converter.convert(789_567_361_890_000_321)
"сімсот вісімдесят дев'ять квадрильйонів п'ятсот шістдесят сім трильйонів триста шістдесят один мільярд вісімсот дев'яносто мільйонів триста двадцять один"
# Float number
converter.convert(132.41)
"сто тридцять дві цілих сорок одна сота"
Run tests
python3 -m unittest tests.num_to_str_repr
License
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
num_to_str_repr-0.0.4.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for num_to_str_repr-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cac084f87dd5ea32f5d988cb0ef29fbb0a07a35e5f10d3f3b53fa291705b8c0b |
|
MD5 | ac22a52b09f8fd890db4e9ea82d58bbd |
|
BLAKE2b-256 | 9ffd6f861531080aea30121e2aef7c7db1792178a2494548a5c77d0ca1c25aba |