intcomma returns exponential notation for large floats
维护者通常 1 天内回复
评估
调研方向
首先找到 intcomma() 及其测试,然后重现报告中 intcomma(1e16) 与 intcomma(10**16) 之间的差异;issue 未提及文件路径。检查格式化流程如何处理 1e16 及以上的浮点数,同时保留 ndigits 原有的行为。当大浮点数返回 '10,000,000,000,000,000.0' 且相关测试通过时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Description
intcomma() returns exponential notation instead of a comma-grouped number for
large floats. The exponent form starts at 1e16, while the equivalent integer
and smaller floats are grouped correctly.
Reproduction
>>> import humanize
>>> humanize.intcomma(1e16)
'1e+16'
>>> humanize.intcomma(10**16)
'10,000,000,000,000,000'
>>> humanize.intcomma(1e15)
'1,000,000,000,000,000.0'
Expected
intcomma(1e16) should be '10,000,000,000,000,000.0', matching the behaviour
for floats below 1e16.
Cause
f"{value:,}" falls back to scientific notation for floats at or above 1e16,
which bypasses the comma grouping. The ndigits path is not affected.
- 主要语言
- Python
- 星标
- 768
- 派生
- 243
- 平均合并
- 4 天 12 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-humanize/humanize 的其他 Issue
-
naturalsize() truncates non-integer byte counts below the base ("1 Bytes")可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
python-humanize/humanize#459 · 2 条评论 ·
维护者通常 1 天内回复
-
intcomma returns scientific notation for large floats可能已有人在做 @TheNetherWatcher 于 47 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
python-humanize/humanize#431 ·
维护者通常 1 天内回复
-
metric() adds a digit when a value rounds into quetta可能已有人在做 @SashaMIT 于 49 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
python-humanize/humanize#423 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 25/100
python-humanize/humanize#512 · 1 条评论 ·
维护者通常 1 天内回复
-
naturalsize() ignores the locale decimal separator可能已有人在做 @ekanshul 于 29 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
python-humanize/humanize#460 ·
维护者通常 1 天内回复
查看 python-humanize/humanize 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
mozilla-ai/cq#601 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gates可能已有人在做 @hat-im 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps it可能已有人在做 @paulo-0308 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
Diaoul/subliminal#1405 ·
-
难度 2/5 1-3 小时 新手友好度 78/100