What did you do?
import humanize
print(humanize.metric(9.996e30))
print(humanize.metric(9.996e31))
print(humanize.metric(9.996e32))
print(humanize.metric(9999))
What did you expect to happen?
Three digits, same as 9999, which is already 10.0 k and not 10.00 k.
10.0 Q
100 Q
1.00 x 10³³
10.0 k
9.996e32 has no prefix after quetta, so scientific notation.
What actually happened?
10.00 Q
100.0 Q
1000 Q
10.0 k
The rounding carry stops at exponent 30. 2.596e32 is still 260 QF.
What versions are you using?
- OS: macOS
- Python: 3.14
- Humanize: main
What did you do?
What did you expect to happen?
Three digits, same as
9999, which is already10.0 kand not10.00 k.9.996e32has no prefix after quetta, so scientific notation.What actually happened?
The rounding carry stops at exponent 30.
2.596e32is still260 QF.What versions are you using?