Open
Conversation
- kB / MB means decimal units: 1000, 1,000,000. - KiB / MiB means binary units: 1024, 1,048,576. We were calculating binary units while labeling them as decimal ones.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a common kB/KiB unit confusion by changing the byte formatting from binary units (1024-based) to decimal units (1000-based) while maintaining the correct kB/MB labels. This aligns with international SI standards where kB means 1000 bytes and MB means 1,000,000 bytes, as opposed to binary units (KiB/MiB) which use powers of 1024.
Changes:
- Updated
useBytesFormatterto use decimal base (1000) instead of binary base (1024) for byte calculations - Added comprehensive unit tests to verify correct decimal-based formatting behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/composables/useNumberFormatter.ts | Changed byte formatting from binary (1024) to decimal (1000) base, introduced KB and MB constants |
| test/unit/app/composables/use-number-formatter.spec.ts | Added new test suite covering byte, kB, and MB formatting with decimal base |
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.
We were calculating binary units while labeling them as decimal ones.