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

ByteSize - implement IEEE conformity. fixes #592 #594

Closed
wants to merge 4 commits into from

Conversation

Alexander882
Copy link

Fixed the ByteSize classes so they now conform to the IEEE 1541 standard, i.e. 1 kilobyte = 1000 bytes instead of 1024 bytes. Also added the IEC prefixes; kibi-, mebi-, gibi-, and tebi-, where 1 kibibyte = 1024 bytes etc. in the same manner as the kilo- prefixes worked before.

Added parsing support for negative byte amounts.

Made TryParse return false instead of throwing an exception when given null or whitespace input, so it works like other TryParse-methods.

…exception on null and empty values, just like other TryParse methods
Added tests &  fixed the double comparison assertions
Corrected the symbol for kibibytes to use a capital K
@MehdiK MehdiK closed this Dec 4, 2017
@MehdiK
Copy link
Member

MehdiK commented Dec 4, 2017

Discussing this on #657

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.

None yet

3 participants