Skip to main content

Convert integers into long-form -illion notation (million, billion, ...)

Project description

pyillion

PyPI Python License Wheel Status

Convert integers into long-form and short form -illion notation
(million, billion, trillion, …) with high precision and simplicity.


✨ Features

  • 🔢 Convert large integers to human-readable illion format
  • ⚡ Lightweight, zero dependencies
  • 🧮 Custom decimal precision
  • 🧠 Simple and explicit API
  • 📦 Clean src-layout, PyPI-ready

📦 Installation

pip install pyillion

🚀 Quick Start

from pyillion import illionify

print(illionify(1234567890))
# 1.234 billion

With custom precision:

print(illionify(1234567890, r=4))
# 1.2345 billion

With short form:

print(illionify(1234567890, short=True))
# 1.234B

🧩 API Reference

illionify(n: int, r: int = 3, short = False) -> str

Turn a number into long-form or short-form -illion notation.

illionify(9876543210)
# '9.876 billion'

il(n: int, bl: bool = False)

Return the -illion name corresponding to n.

il(7)
# 'sextillion'

il(7, bl=True)
# 1000 ** 7

il_short(n: int, bl: bool = False)

Return the short form -illion name corresponding to n.

il_short(7)
# 'Sx'

il(7, bl=True)
# 1000 ** 7

e(n: int)

Return 1000 ** n.

e(4)
# 1000000000000

d(a, b, r: int = 3)

Safe division with fixed decimal precision.

d(215, 11, 4)
# 19.5454

📁 Project Structure

pyillion/
├─ src/
│  └─ pyillion/
│     ├─ __init__.py
│     └─ illionifyer.py
├─ pyproject.toml
├─ README.md
└─ LICENSE

🧪 Supported Python Versions

  • Python 3.8+
  • Tested on 3.13 / 3.14

📜 License

This project is licensed under the MIT License.
See LICENSE for details.


🌐 Links


⭐ Why pyillion?

If you need:

  • deterministic formatting
  • full control over -illion logic
  • no hidden heuristics like humanize

pyillion is for you.

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

pyillion-1.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyillion-1.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pyillion-1.2.0.tar.gz.

File metadata

  • Download URL: pyillion-1.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyillion-1.2.0.tar.gz
Algorithm Hash digest
SHA256 fd61d0938f1779cb9e38e97be5b45ab8e915661cc8f120a921f9f8e87deb962c
MD5 b2137498b38f4fa04b01e5230d5d9927
BLAKE2b-256 c1b4d22f64672afabc0ba2cab5733ef6d07ddd44f5e77ce3444180c5111e1ed3

See more details on using hashes here.

File details

Details for the file pyillion-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyillion-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyillion-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fed758914f651d2e26668863f279103b7a0d952fc84bc2321938ff42114dc943
MD5 f85aed4df8932d19e12b9956669f77c4
BLAKE2b-256 0a057d04cfbc08b22bb6e528f2f7d552450c5dbc5c12f41bdbe2fb64c360a725

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page