Skip to content

numfmt: cap IEC precision at 3 decimals#11959

Merged
cakebaker merged 1 commit into
uutils:mainfrom
pocopepe:11926
Apr 25, 2026
Merged

numfmt: cap IEC precision at 3 decimals#11959
cakebaker merged 1 commit into
uutils: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

github-actions Bot commented Apr 23, 2026

Copy link
Copy Markdown

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

codspeed-hq Bot commented Apr 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 309 untouched benchmarks
⏩ 46 skipped benchmarks1


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

Open in CodSpeed

Footnotes

  1. 46 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.

@cakebaker cakebaker merged commit e348e13 into uutils:main Apr 25, 2026
230 of 247 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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)

2 participants