Skip to content

feat: use IEC binary size prefixes #2483

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

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

Andrew15-5
Copy link
Contributor

@Andrew15-5 Andrew15-5 commented Oct 20, 2023

I'm very happy that this project uses 1024 as a divisor instead of 1000. But to explicitly inform user about it the prefixes should consist of 3 letters:

  • multiple (K, M, G, T)
  • 'i' (bInary)
  • 'B' (Byte)

Exception is any number of bytes that are less than 1024, then the prefix is just the 'B' letter.

As an addition I've completed the list with the missing prefixes: P, E, Z, Y.

Quick reference: https://en.wikipedia.org/wiki/Binary_prefix.

P.S. Ri and Qi are not yet confirmed (only SI counterparts exist starting from 2022: R, Q).

@alex-courtis alex-courtis changed the title Added explicit binary prefixes feat: use SI binary size prefixes Oct 21, 2023
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your contribution.

We will indeed be using decimal prefixes over my dead body.

@alex-courtis
Copy link
Member

I'll need you to rebase as I don't have push privileges to your fork.

@Andrew15-5
Copy link
Contributor Author

Wait-wait-wait, hold on. So, you're approving of my changes, but saying that you will use decimal prefixes? And the title now has "SI binary size"?

If you look at the table in the link, there is a separate decimal column and binary column or SI and IEC. Decimal is for multiples of 1000 and binary is for multiples of 1024.

So tell me, which pill do you take? (red or blue) /jk

@alex-courtis
Copy link
Member

alex-courtis commented Oct 21, 2023

Wait-wait-wait, hold on. So, you're approving of my changes, but saying that you will use decimal prefixes? And the title now has "SI binary size"?

If you look at the table in the link, there is a separate decimal column and binary column or SI and IEC. Decimal is for multiples of 1000 and binary is for multiples of 1024.

So tell me, which pill do you take? (red or blue) /jk

Bad joke; binary it is.

I'm happy, just need a rebase before I can merge. Check "allow edits by maintainers" next time so I can do it for you.

@Andrew15-5 Andrew15-5 changed the title feat: use SI binary size prefixes feat: use IEC binary size prefixes Oct 21, 2023
@alex-courtis alex-courtis merged commit 83b6995 into nvim-tree:master Oct 21, 2023
@Andrew15-5
Copy link
Contributor Author

I have found a bug (because I didn't know how the logic works exactly) and 2 more improvements. Expect a new PR in the next 24 hours.

@alex-courtis
Copy link
Member

I have found a bug (because I didn't know how the logic works exactly) and 2 more improvements. Expect a new PR in the next 24 hours.

Many thanks for your diligence.

I don't think we need to revert as we'll fix it quickly.

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.

2 participants