Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size reported incorrectly due to usage of factor 1024 #218

Closed
MatthiasKunnen opened this issue Mar 28, 2021 · 2 comments · Fixed by #219
Closed

Size reported incorrectly due to usage of factor 1024 #218

MatthiasKunnen opened this issue Mar 28, 2021 · 2 comments · Fixed by #219

Comments

@MatthiasKunnen
Copy link
Contributor

What happens
When the size is 4632 bytes, size-limit reports 4.52 KB. However, this size is in KiB. This is due to the bytes package not currently following, and not willing to follow, the standard set forth by ISO, BIPM, and IEC.

What should happen
size-limit should follow the standard and report 4.63 KB.

Solution
Use a package like pretty-bytes or bytes-iec which follows the standards and converts sizes properly.

@ai
Copy link
Owner

ai commented Mar 28, 2021

I like the idea of moving KiB units =^_^=

Can you send PR and change the text in the code? You can replace bytes with any library, which has 0 dependencies.

@ai
Copy link
Owner

ai commented Mar 30, 2021

Fix was released in 4.10.2

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 a pull request may close this issue.

2 participants