mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[PR #571] fix: use IEC prefixes (Ki, Mi, Gi) for base-1024 size display #554
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/bootandy/dust/pull/571
Author: @ChihebBENCHEIKH1
Created: 4/17/2026
Status: 🔄 Open
Base:
master← Head:fix/iec-unit-prefixes📝 Commits (1)
0a74f3bfix: use IEC prefixes (Ki, Mi, Gi) for base-1024 size display (#570)📊 Changes
2 files changed (+87 additions, -71 deletions)
View changed files
📝
src/display.rs(+47 -31)📝
tests/test_exact_output.rs(+40 -40)📄 Description
Closes #570
dust calculates sizes using base-1024 (binary/IEC) by default but displays them with SI prefixes (K, M, G), which is misleading since SI prefixes imply powers of 1000.
Before:
1.0M(ambiguous — is this 1,000,000 or 1,048,576 bytes?)After:
1.0Mi(clearly 1,048,576 bytes, base-1024)SI mode (
-o si) continues using K, M, G with base-1000 as expected.Changes:
UNITSarray withSI_UNITSandIEC_UNITShuman_readable_number()andget_number_format()now select the correct suffix based on the output format🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.