fix: use IEC prefixes (Ki, Mi, Gi) for base-1024 size display#571
Open
ChihebBENCHEIKH1 wants to merge 1 commit intobootandy:masterfrom
Open
fix: use IEC prefixes (Ki, Mi, Gi) for base-1024 size display#571ChihebBENCHEIKH1 wants to merge 1 commit intobootandy:masterfrom
ChihebBENCHEIKH1 wants to merge 1 commit intobootandy:masterfrom
Conversation
…dy#570) dust was calculating sizes using base-1024 (IEC) but displaying them with SI prefixes (K, M, G). This is misleading since SI prefixes imply powers of 1000. Now base-1024 values use proper IEC prefixes (Ki, Mi, Gi, Ti, Pi) and base-1000 values (via -o si) continue using SI prefixes (K, M, G, T, P).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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