Millify is a lightweight Python library designed to convert large numbers into human-readable, "millified" formats, similar to how social media platforms display follower counts (e.g., 1,234,567 becomes 1.23M). It currently stands at version 0.1.1 and has a relatively slow release cadence, with updates focused on minor improvements and bug fixes.
pip install millifyVerified import paths — ran on the pinned version, not inferred.
Demonstrates the basic usage of the `millify` function to convert numbers, including setting precision, specifying decimal places, and using custom prefixes for different scaling requirements.
Choose either `precision` for significant digits or `decimal_places` for digits after the decimal point based on desired behavior. Do not use both simultaneously unless you intend `decimal_places` to override.
Pass a list of custom prefixes using the `prefixes` argument (e.g., `prefixes=['', 'KB', 'MB', 'GB']`) to match your specific domain requirements.
Set `drop_zeros=False` in the `millify` function call to retain trailing zeros after the decimal point.
Ensure the value passed to `millify` is an integer or a float.
Remove the `decimal_places` argument if you are using `precision`. If you need to keep trailing zeros, set `drop_zeros=False`.