Skip to content

numfmt: cap IEC precision at 3 decimals#11959

Open
pocopepe wants to merge 1 commit intouutils:mainfrom
pocopepe:11926
Open

numfmt: cap IEC precision at 3 decimals#11959
pocopepe wants to merge 1 commit intouutils:mainfrom
pocopepe:11926

Conversation

@pocopepe
Copy link
Copy Markdown
Contributor

Fixes #11926

Added effective_precision = precision.min(3) for iec units in consider_suffix to match gnu's rounding behaviour. Tests added for both the IEC cap and that SI is unaffected.
Verified against GNU 9.4.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/retry is no longer failing!
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/cut/bounded-memory is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will not alter performance

✅ 240 untouched benchmarks
⏩ 115 skipped benchmarks1


Comparing pocopepe:11926 (9c0bf0e) with main (cdcbee3)

Open in CodSpeed

Footnotes

  1. 115 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

numfmt: --to=iec with high-precision --format reveals extra digits (differs from GNU)

1 participant