This module provides functions for getting the English names of numbers.
Project description
Number Names
number_names
converts numbers to their English names.
The main useful function this package provides is called name
. Usage
is as follows:
>>> import number_names
>>> number_names.name(0)
'zero'
>>> number_names.name(1)
'one'
>>> number_names.name(2)
'two'
>>> number_names.name(123_456_789)
'one hundred and twenty three million four hundred and fifty six thousand seven hundred and eighty nine'
>>> number_names.name(3.1415)
'three point one four one five'
>>> number_names.name(-10 ** 15)
'minus one quadrillion'
>>> number_names.name(10 ** 100000)
'ten tretriginmilliatrecenduotrigintillion'
>>> number_names.name(3 + 2j)
'three plus two i'
>>> from fractions import Fraction
>>> number_names.name(Fraction(1, 2))
'one half'
>>> number_names.name(Fraction(3, 221))
'three two hundred and twenty firsts'
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
number_names-0.1.0.tar.gz
(17.0 kB
view details)
Built Distribution
File details
Details for the file number_names-0.1.0.tar.gz
.
File metadata
- Download URL: number_names-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e37af15c4c53508b2862f5cd747a5b15ef8560b7a23bfd9817512d3457a2e61 |
|
MD5 | 9334b1c82a1aa24b3659922a974f57a8 |
|
BLAKE2b-256 | 60b63401ade145150bf9e1f721135d771f376daf71cd3d219a7fbae8ce55d604 |
File details
Details for the file number_names-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: number_names-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1bc33c96930386c2890c838752744c8f21f7c75a8aeab8f23000d7f929b0d4b |
|
MD5 | ed19eaa1b4016bd3c5bf52728bbb9679 |
|
BLAKE2b-256 | e44a31ef5d03163b833aa78276309e01dfaa143c723729517021da4da48674d1 |