Skip to main content

wordify

Wordify is a Python class that converts a given number into its word representation. It can convert numbers up to centillions.

Usage

  1. From converter import the needed class (you have IntegerConverter and DecimalConverter)

    from wordify.converter import IntegerConverter
    from wordify.converter import DecimalConverter
    
  2. Create an instance of the Converter class by providing a number to be converted.

    int_number = 12345
    int_converter = IntegerConverter(int_number)
    dec_number = 123.45
    dec_converter = DecimalConverter(dec_number)
    
  3. Convert the number to its word representation using the convert method.

    int_word_representation = int_converter.convert()
    dec_word_representation = dec_converter.convert()
    
  4. Print the word representation.

     print(int_word_representation)  # output: twelve thousand and three hundred forty five
     print(dec_word_representation)  # output: one hundred twenty three point four five
    

Example

from converter import IntegerConverter

# Create a Converter instance with a number
number = 12345
converter = IntegerConverter(number)

# Convert the number to words
word_representation = converter.convert()

# Print the word representation
print(word_representation)   # output: twelve thousand and three hundred forty five

Customization

You can set a new number for conversion using the set_number method.

converter.set_number(98765)

After setting the new number, you need to call the convert method again to obtain the word representation.

License

The code in this repository is licensed under the MIT License.

You can find the full text of the license in the LICENSE file. For more information, please visit the repository on GitHub.

Metadata

Release files for wordify 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wordify 1.5.0
File Size Uploaded
wordify-1.5.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wordify 1.5.0
File Interpreter ABI Platform
wordify-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / wordify-1.5.0.tar.gz

Download URL wordify-1.5.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f5bab037649944c6dd4ddadf7f52b2fa0032171aa0e5061dc73c84806332ce1b
BLAKE2b-256 checksum
How to use checksums
5abf8cada5a47bf364868e81e5b4c5e28ac654bb969a43ed8fc6d919f0cfbc79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / wordify-1.5.0-py3-none-any.whl

Download URL wordify-1.5.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a87e52eac4b983622f1963ef3846e677874e03c93523ca04146324a5d41b48b5
BLAKE2b-256 checksum
How to use checksums
34a9bbb7289b8f1e10391f2d29e163bcd1ade8dc0e0dfbbb7c167992dbcb4bf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page