Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add humanize.metric() for converting big/small numbers to SI units #22

Merged
merged 2 commits into from Jun 19, 2022

Commits on Jun 17, 2022

  1. Fix scientific() on small positive numbers.

    Checking a number is negative using `'-' in string_value` leads to confusion
    because 1e-30 and -1e30 both contain a '-' but only one of them is negative.
    This bug had found its way into the tests and the docstring.
    
    Additionally, the removal of redundant leading '0's and '+'s from the exponent
    would only kick in if both were present so that 1e20 would become 10⁺²⁰ instead
    of just 10²⁰ and the insertion of negative exponents could lead to outputs such
    as 3.00 x 10⁻⁺²⁰.
    bwoodsend committed Jun 17, 2022
    Copy the full SHA
    43ebe21 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2022

  1. Copy the full SHA
    19726a0 View commit details
    Browse the repository at this point in the history