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 hashes)
Built Distribution
Close
Hashes for number_names-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1bc33c96930386c2890c838752744c8f21f7c75a8aeab8f23000d7f929b0d4b |
|
MD5 | ed19eaa1b4016bd3c5bf52728bbb9679 |
|
BLAKE2b-256 | e44a31ef5d03163b833aa78276309e01dfaa143c723729517021da4da48674d1 |