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

Use correct units for base 2 #80

Closed
ryank109 opened this issue Feb 23, 2016 · 6 comments
Closed

Use correct units for base 2 #80

ryank109 opened this issue Feb 23, 2016 · 6 comments

Comments

@ryank109
Copy link

For formatting the data size with base 2, the units need to be kiB, MiB, GiB instead of kB, MB, GB according to IEC standards.

@avoidwork
Copy link
Owner

Hi,

Should the standard be a parameter? SI and JEDEC are currently supported, to do a third I feel that we need to specify which base 2 standard you expect for output.

@avoidwork
Copy link
Owner

@ryank109
Copy link
Author

Not sure if you need a parameter for this, since SI = base10, (Ki, Mi, Gi) = base2? I was just noticing that the symbols were wrong for the formatted outputs.

There might be also concerns for changing this that might affect the current usage of the library. So, if I may suggest, have the default be base 10 instead of base 2? That way, people do not get any sudden changes in their application and have correct number and units. :)

@avoidwork
Copy link
Owner

Oh boy, people wouldn't be happy! 2.0.x was base 10, and there's bugs about how "your math is wrong" or something silly.

JEDEC (base 2) is the standard for memory, and is what most software & people expect to read. IEC is a newer representation, and I think it makes sense as a feature, but I guarantee you it should be an option and not a default. The majority of the existing user base is expecting JEDEC by default; it's a pretty big user base stats.

@ryank109
Copy link
Author

You are definitely right about how it's being used. It seems the standard does note that it is misusing the units to avoid confusion, but also mentions that it is deprecated as well. https://en.wikipedia.org/wiki/JEDEC_memory_standards#cite_note-4 -- pardon my reference to the wiki page.. :)

I guess I can always pass in base 10 option for format, so not necessary to add anything. If you feel there should be more discussion around this, feel free to keep the issue open, otherwise, you can close it. Thanks.

@avoidwork
Copy link
Owner

ok 👍

avoidwork added a commit that referenced this issue Apr 23, 2016
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

2 participants