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

@mstefarov mstefarov commented Nov 18, 2013

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 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
@JasonRitchie
Copy link

@JasonRitchie JasonRitchie commented May 28, 2015

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 omar commented Dec 1, 2016

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

@omar
Copy link
Owner

@omar 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 omar commented Dec 24, 2018

Track progress in #24

@omar omar closed this Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.