--- id: sigfig version: "1.3.19" license: MIT License license_treatment: permissive maintenance: aging --- # sigfig — Python library for rounding numbers (with expected results) License: permissive · Maintenance: aging · Downloads: 824.2K/mo ## What it is and what it does sigfig is a Python library that fixes the unintuitive behavior of Python's built-in round() function by providing mathematically correct rounding based on significant figures, decimal places, or measurement uncertainty. It accepts numbers in multiple formats (int, float, string) and returns rounded results as strings or formatted output. The package is designed for scientific, financial, and educational contexts where rounding precision matters. It supports several output formats including Drake notation and uncertainty representation, making it useful for publishing results, displaying measurements with error bounds, or ensuring consistent numerical behavior across calculations where standard Python rounding would give unexpected results. Use it for: - Round measurement data with associated uncertainty for scientific publications or lab reports. - Format financial figures to significant digits for regulatory or presentation purposes. - Ensure consistent rounding behavior in educational software or numerical computing workflows. - Convert numeric results to publication-ready strings with appropriate precision notation. - Handle rounding in physics or chemistry calculations where significant figures are critical. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Rounds numbers by significant figures, decimal places, or uncertainty, and formats them in multiple scientific and publication styles with results that match expected mathematical behavior. Yes, if you need reliable significant-figure or uncertainty-based rounding. The package is stable (Production/Stable status), permissively licensed, has no known vulnerabilities, and carries low install friction. The aging maintenance status (last release 522 days ago) is not a blocker for a mature rounding library, but verify that its behavior matches your specific rounding requirements before adopting it in new projects. ## Install pip install sigfig uv add sigfig poetry add sigfig ## Installing sigfig Before you install: Low install friction with a single lightweight dependency (sortedcontainers). Last release was 522 days ago; the repository is not archived and receives occasional updates, though the aging maintenance status suggests infrequent active development. License in practice: MIT License permits commercial and private use, modification, and distribution with minimal restrictions, making it suitable for most projects without licensing concerns. Quickstart: pip install sigfig from sigfig import round round(3.14159, sigfigs=2) # Returns '3.1' round(0.25, decimals=1) # Returns '0.3' Requires Python 3.8 or later (supports up to 3.12). Verify before relying: - Whether the package handles edge cases like very large numbers or extreme precision requests gracefully. - Performance characteristics when rounding large datasets or in tight loops. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 824.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags round by significant figures, scientific rounding, uncertainty rounding, number formatting scientific, sigfigs rounding, decimal rounding with precision, publication number format, numeric-precision, scientific-computing [View on SkillFed](https://skillfed.io/packages/sigfig) · [View on PyPI](https://pypi.org/project/sigfig/)