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

[fixes]ZIM size being advertized inconsistently between MB and MiB #1096

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

harsha-mangena
Copy link
Contributor

@harsha-mangena harsha-mangena commented Jun 21, 2024

Fixes #1095

  • Switched from decimal (MB) to binary (MiB) units for file sizes
  • Used powers of 1024 instead of 1000 for size calculations
  • Adjusted precision to display up to 3 significant digits
  • Updated unit labels to KiB, MiB, GiB, TiB
  • Implemented log2-based calculation for determining appropriate unit

@kelson42
Copy link
Collaborator

@harsha-mangena Thank you for your PR but please complete your PR by updating the cacheid (read the README for the details).

@kelson42 kelson42 requested a review from veloman-yunkan June 22, 2024 15:04
@veloman-yunkan veloman-yunkan force-pushed the i1095-consistancy-issue branch from 3255148 to 9115504 Compare June 24, 2024 08:02
Switched display of ZIM sizes from decimal (MB) to binary (MiB) units.

Also made the size value to be formatted in a more human friendly way
(fractional part is shown only to provide at least three significant
digits).
@veloman-yunkan veloman-yunkan force-pushed the i1095-consistancy-issue branch from 9115504 to 97832c8 Compare June 24, 2024 08:42
@kelson42
Copy link
Collaborator

@veloman-yunkan Thx for the cacheid. Good to merge?

@veloman-yunkan
Copy link
Collaborator

@harsha-mangena Thanks for the PR!

I improved the commit message as well as changed the formatting of the size value (the fractional part is presented so as to ensure at least 3 significant digits). I also updated the cacheids in the unit tests.

@veloman-yunkan veloman-yunkan merged commit 964131c into kiwix:main Jun 24, 2024
14 checks passed
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 this pull request may close these issues.

ZIM size advertized in library is in MB while users see a MiB value in many other places
3 participants