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.0.2.tar.gz
(17.1 kB
view details)
Built Distribution
File details
Details for the file number_names-0.0.2.tar.gz
.
File metadata
- Download URL: number_names-0.0.2.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5aea313fd41550f90ba996b26a9c51310820d5794eb13527bf0d1e3233d61c |
|
MD5 | 8535c3cf23bb25831b1f6e843142a650 |
|
BLAKE2b-256 | d6cc8780c5b821f6c2e3131ff6df307c4e758b7d45b7c68d53a79a0970ce3afc |
File details
Details for the file number_names-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: number_names-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0a09d4093ab293b8e875546af39b2fa5e82e59970c282c2f90740deb2a1665a |
|
MD5 | e837b5297c8ce25ac8ceaa7bf9f4df44 |
|
BLAKE2b-256 | f01a8206d2654bf0d5ec2a5b7406d0c479682e16e0df3cab09c753f1cbd9b1ed |