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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file num_to_str_repr-0.0.4.tar.gz.
File metadata
- Download URL: num_to_str_repr-0.0.4.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
297b450f0b5f597ec3b0b8bed130eff9d26118eddff546b0593c9a16cf52b241
|
|
| MD5 |
26af709d3e2caea2cad6d9b7d51ec1f1
|
|
| BLAKE2b-256 |
360cb67c27b1e074dd26b17f0fb371bf4bc06744a70811a10d87abcf52253cfd
|
File details
Details for the file num_to_str_repr-0.0.4-py3-none-any.whl.
File metadata
- Download URL: num_to_str_repr-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac084f87dd5ea32f5d988cb0ef29fbb0a07a35e5f10d3f3b53fa291705b8c0b
|
|
| MD5 |
ac22a52b09f8fd890db4e9ea82d58bbd
|
|
| BLAKE2b-256 |
9ffd6f861531080aea30121e2aef7c7db1792178a2494548a5c77d0ca1c25aba
|