/NumWords

NumWords function converts numbers from their numerical form to their semantic form.

Primary LanguagePythonMIT LicenseMIT

PyPI Downloads

NumWords module converts numbers from their numerical form to their international semantic form. Current input limit is 1066-1.

Usage:

Convert integers

from numwords import NumWords
NumWords.convert(12345)
>>> "Twelve Thousand Three Hundred Fourty Five"

Convert numbers with decimals

NumWords.convert(12345.6789)
>>> "Twelve Thousand Three Hundred Fourty Five Point Six Seven Eight Nine"

NumWords.convert("12345.6789")
>>> "Twelve Thousand Three Hundred Fourty Five Point Six Seven Eight Nine"

NumWords.convert(12345.0)
>>> "Twelve Thousand Three Hundred Fourty Five"