A simple, clean and reliable efficient python utility or tool to convert numbers → words and words → numbers.
This repository provides a compact, well-documented Python module that:
- Converts integer and floating-point numbers into English words (supports very large magnitudes).
- Parses English words describing numbers (including a two-digit fractional part after the word
point) back into numeric values.
Repository name: numbers-words-converter
Primary module file: converters.py
Package / distribution name: numbers-words-converter
git clone https://github.com/iamx-ariful-islam/numbers-words-converter.git
cd numbers-words-converter
pip install .
# or
python setup.py installnumbers-words-converter/
│
├── converters.py
├── README.md
├── setup.py
└── test.pyfrom converters import NumToWords, WordsToNum
print(NumToWords(1234567.26))
# output: one million two hundred thirty four thousand five hundred sixty seven point two six
print(WordsToNum("one million two hundred thirty four thousand five hundred sixty seven point two six"))
# output: 1234567.26- Fractional handling expects exactly two digits after the word point. If fewer than two words follow point, zeros are appended. Example: "point five" → 0.50.
- Input words should be lowercase or will be lowercased internally. Avoid punctuation except digits if mixing numeric tokens.
- Supports very large magnitudes up to "vigintillion" (as defined in the module).
- This is a pure parsing/formatting utility — it does not provide authentication, I/O formatting beyond examples, or localization (English only).
- For production use, validate input strings and consider wrapping calls with try/except for error handling.
| Situation | Markdown Syntax | Example |
|---|---|---|
| Normal text | Just type it | 1234.56 |
| Inside code | Backticks | `NumToWords(12.34)` |
| Inside code block | Triple backticks | python ... |
| Start of line | Escape dot | 1\.23 |
Would you like me to modify your existing README.md file so that all decimal numbers (like 1234567.26, 3.5 etc.) are properly formatted and displayed cleanly?
Contributions, suggestions, and feedback are always welcome! ❤️ To contribute:
- Fork the repository
- Create a new branch (
feature/new-feature) - Commit your changes
- Push and submit a Pull Request
💬 You can also open an issue if you’d like to discuss a feature or report a bug.
The MIT License (MIT)