metric() adds a digit when a value rounds into quetta
维护者通常 2 天内回复
评估
调研方向
从 metric() 入口开始,运行 issue 中所示的复现,以确认 quetta 边界行为。跟踪 9.996e30 到 9.996e32 附近的舍入和前缀选择,然后验证输出与四个预期示例一致,并保留现有的 9999 结果。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 760
- 派生
- 166
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-humanize/humanize 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
python-humanize/humanize#438 ·
维护者通常 2 天内回复
-
intcomma returns scientific notation for large floats可能已有人在做 @TheNetherWatcher 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
python-humanize/humanize#431 ·
维护者通常 2 天内回复
-
docs: document how to run the test suite locally可能已有人在做 @yuefdev 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
python-humanize/humanize#430 ·
维护者通常 2 天内回复
-
precisedelta() silently drops the sign of negative timedeltas可能已有人在做 @Mukller 于 41 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
python-humanize/humanize#379 ·
维护者通常 2 天内回复
-
`naturalsize()` raises `ValueError` for custom format strings with text可能已有人在做 @Sanjays2402 于 65 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
python-humanize/humanize#366 ·
维护者通常 2 天内回复
查看 python-humanize/humanize 的全部 Issue
相似的 Issue
-
feature:LinkChecker
难度 2/5 1-3 小时 新手友好度 66/100
digitalfabrik/integreat-cms#4594 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
EleutherAI/lm-evaluation-harness#4319 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")可能已有人在做 @mayureshsonawane17 今天认领。 未关闭Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 5 天内回复