Skip to main content

To convert numbers in word form to digits

Project description

WordToDigits Package

Author: Abhishek Rawat

This package is used to convert the numbers present in word form in an input passage to the traditional numeric (digits) form. The word representation of numbers could be anywhere in the passage. It works from zero to nine hundred and ninety nine million nine hundred and ninety nine thousand and nine hundred and ninety nine. It also takes care of the decimal part, if present.

An example on how to use the package is shown below:-

import wordtodigits

text1 = 'A car accelerates for five point two one seconds for a distance of one hundred and ten meters.'
print(wordtodigits.convert(text1))
#A car accelerates for 5.21 seconds for a distance of 110 meters.

text2 = 'three thousand and fifty three point five is the final score'
print(wordtodigits.convert(text2))
#3053.5 is the final score

If you find any bugs, or have any suggestions for improvement, contact me at abhishek18.official@gmail.com

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

wordtodigits-1.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

wordtodigits-1.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file wordtodigits-1.0.2.tar.gz.

File metadata

  • Download URL: wordtodigits-1.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for wordtodigits-1.0.2.tar.gz
Algorithm Hash digest
SHA256 42d502a36d6634e5e5c1a502619ef322d02264a3185310955d6fdcfdddb242ef
MD5 e9cc7188bc178116f4115c3816365c46
BLAKE2b-256 9e789a2cc321fe2dd4013cbce85b99da50ddb21db200a9c51c70a14aea3de1b3

See more details on using hashes here.

File details

Details for the file wordtodigits-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: wordtodigits-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for wordtodigits-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 810cf406b1731d22c39ae0879c547072d122ad46a0068d8a9191b76c4d9d0b09
MD5 0cd2d165b6922e313ff3fb55466501fa
BLAKE2b-256 124bc8b2018a6cd15f0a5a9113ba34f8fc25519c220c5f3e7a3dad88def62cc3

See more details on using hashes here.

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