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

Request: Add support for binary prefixes (KiB/MiB) in addition to decimal prefixes (KB/MB) #1

Closed
mstefarov opened this issue Nov 18, 2013 · 5 comments

Comments

@mstefarov
Copy link

It would be very useful to add an option to handle both binary prefixes (kibi/mebi/gibi/tebi/pebi) and decimal prefixes (kilo/mega/giga/tera/peta), for parsing and formatting.

@omar
Copy link
Owner

omar commented Nov 19, 2013

I thought about adding support for this, however, I had a hard time thinking of a good API for it.

  1. I think it would warrant a rename of the class to something more generic like MemorySize, DataSize, or something better as I don't think the previous two really fit.
  2. This biggest change would be to the API to allow for easy access. Some options:
    • Create subtype (BitSize) that would properties for bits:
      • main.Bits.KiloBits
      • main.Bits.MegaBits,
    • Continue using the same class with additional properties
      • main.KiloBits
      • main.MegaBits

@MadelineRitchie
Copy link

Re: 1. Bytes and bits are used in both the decimal and binary space, so keeping the name ByteSize is not inaccurate.

@omar
Copy link
Owner

omar commented Dec 1, 2016

FYI, I started some work on this in 166ccbb.

@omar
Copy link
Owner

omar commented Dec 24, 2018

I decided to make this v2 given the changes that went into. An alpha is up on NuGet https://www.nuget.org/packages/ByteSize/2.0.0-alpha1

@omar
Copy link
Owner

omar commented Dec 24, 2018

Track progress in #24

@omar omar closed this as completed Dec 24, 2018
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

No branches or pull requests

3 participants