fix: more intuitive byte formatting boundaries for rounding#8840
Merged
wraithgar merged 1 commit intonpm:latestfrom Dec 11, 2025
Merged
fix: more intuitive byte formatting boundaries for rounding#8840wraithgar merged 1 commit intonpm:latestfrom
wraithgar merged 1 commit intonpm:latestfrom
Conversation
wraithgar
reviewed
Dec 9, 2025
Member
|
Why was this only done for two of the units? |
Contributor
Author
|
This fix prevents inconsistencies caused by
|
Contributor
Author
|
rebase on the latest and added the tests to tar as suggested |
wraithgar
approved these changes
Dec 11, 2025
Merged
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.
WHY/WHAT
Fixed non-intuitive unit rounding for byte formatting. Previously, values close to a unit boundary (e.g. 999,999 B) displayed incorrectly as the smaller unit. We adjusted the conversion threshold (e.g. to 999,950 B for MB) to leverage standard
toFixed(1)rounding, ensuring values that arealmost 1.0of the next unit are correctly displayed as 1.0 MB, prioritizing a better user experience.