This project is a proposed solution for a Google interview question involving converting numbers into words. The program takes an integer as input and returns its English word representation.
- Input:
438237764
- Output:
Four Hundred Thirty Eight Million Two Hundred Thirty Seven Thousand Seven Hundred Sixty Four
-
Clone the repository:
git clone https://github.com/your-username/number-to-words.git
-
Navigate to the project directory:
cd number-to-words
-
(Optional) Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
To use the number-to-words converter, simply import and use the NumberToWords
class in your code:
from number2string import NumberToWords
converter = NumberToWords()
result = converter.number2string(438237764)
print(result) # Output: Four Hundred Thirty Eight Million Two Hundred Thirty Seven Thousand Seven Hundred Sixty Four