Skip to main content

A simple and better version of numerize package that also denumerizes

Project description

numerize_denumerize

A python package to numerize and denumerize numbers.

Installation

pip3 install numerize_denumerize

Usage

from numerize_denumerize import numerize, denumerize
print(numerize.numerize(10000000, decimal_points=2))  # '10.00M'
print(denumerize.denumerize('10.00M'))  # 10000000

Methods

numerize(number, decimal_points=2)

This method takes a number and returns a string in the format of x.xxM or x.xxK or x.xxB based on the number.

denumerize(number_string)

This method takes a string in the format of x.xxM or x.xxK or x.xxB and returns the actual number.

Note

Please make sure you provide correct format while calling denumerize method.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

numerize_denumerize-0.0.6.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

numerize_denumerize-0.0.6-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

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