omar / ByteSize

ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time.
MIT License
558 stars 50 forks source link

[Cosmetic] "k" vs. "K": Wrong symbol for KiloByteSymbol constant in DecimalByteSize.cs #41

Open elgonzo opened 4 years ago

elgonzo commented 4 years ago

The KiloByteSymbol in DecimalByteSize.cs (line 14) is incorrectly declared as "KB".

The uppercase "K", is considered an informal (non-standard) notation for 1024 bytes (=KiB). The correct unit prefix for 1000 is lowercase "k".

(By the way, one of the Wikipedia articles linked in the readme.md also points this out: https://en.wikipedia.org/wiki/Kilobyte#Definitions_and_usage ;-) )

sandrock commented 4 years ago

Informal usage is a thing. Displaying non-ambiguous facts is another.

I think the "B" should not be omitted and I would vote to change for:

public const string KiloByteSymbol = "kB";

Thoughts?

elgonzo commented 4 years ago

@sandrock, my issue report is not about omitting the "B" (a unit). My issue report is regarding lowercase k vs. uppercase K (a unit prefix). And my recommendation is essentially the same as yours: using "kB" (lowercase k) for 1000 bytes :-)