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