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
0 defaults to bits (b) whereas all other values defaults to bytes (B) #42
This looks really messy when it's used to format a whole table of results etc, it's very rare to actually "see" bits in the wild as most things are usually measured in Bytes. I'm advocating to change the default unit of "0" to be bytes.
Basically:
Console.WriteLine(ByteSize.FromBytes(0).ToString());
outputs0b
Console.WriteLine(ByteSize.FromBytes(1).ToString());
outputs1B
This looks really messy when it's used to format a whole table of results etc, it's very rare to actually "see" bits in the wild as most things are usually measured in Bytes. I'm advocating to change the default unit of "0" to be bytes.