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

Open
fragmer opened this Issue Nov 18, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@fragmer

fragmer 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

This comment has been minimized.

Show comment
Hide comment
@omar

omar Nov 19, 2013

Owner

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

This comment has been minimized.

Show comment
Hide comment
@JasonRitchie

JasonRitchie 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.

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

This comment has been minimized.

Show comment
Hide comment
@omar

omar Dec 1, 2016

Owner

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

Owner

omar commented Dec 1, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment