You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
intcomma returns scientific notation for large floats #431
I expected '10,000,000,000,000,000.0' and '150,000,000,000,000,000,000.0'. Passing ndigits works around it (intcomma(1e16, 0) gives '10,000,000,000,000,000').
This happens because f"{value:,}" on a float uses the same formatting as repr(), and that switches to an exponent at 1e16. Small floats hit the same thing, e.g. intcomma(0.00001) returns '1e-05'.
Activity
fix(intcomma): handle scientific notation for large/small floats
fix(intcomma): handle scientific notation for large/small floats