intcomma returns exponential notation for large floats
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
まず intcomma() とそのテストを見つけ、報告された intcomma(1e16) と intcomma(10**16) の違いを再現してください。issue にはファイルパスの記載がありません。1e16 以上の float をフォーマット処理がどのように扱うかを確認し、ndigits の従来の動作は維持してください。大きな float が '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時間
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-humanize/humanize のほかの issue
-
naturalsize() truncates non-integer byte counts below the base ("1 Bytes")再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 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