Skip to main content

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)

Uploaded Source

Built Distribution

number_names-0.1.0-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page