🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

numerize

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numerize

Convert large numbers into readable numbers for humans.

0.12
PyPI
Maintainers
1

Build Status Python 2.7 Python 3.6 license

Numerize

Numerize is a Python (2 and 3) library for converting large numbers into readable strings. Similar to what Twitter and Instagram use for large follower counts.

NumberNumerized
11
10001K
15001.5K
10000001M
15000001.5M
10000000001B
15000000001.5B
10000000000001T
15000000000001.5T
2132431421.32M
-21324314-21.32M

Installation

$ pip install numerize

Usage

numerize(number_to_numerize, decimal_places_to_round[optional])

>>> from numerize import numerize
>>> numerize(1234567.12)
'1.23M'
>>> numerize(12134.123, 3)
'12.134K'

This will convert large numbers like 1234567.12 into 1.23M

Requirements

  • Python >= 2.7 or >= 3.4

Contributing

How to contribute

Testing

$ python numerize/test.py

License

MIT licensed.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts