Is there an equivalent type for Bytes, just like System.Web.UI.WebControls.Unit
for units?
I imagine a struct which takes the byte count as long and two calculated properties:
- enumeration type with the highest multiple >= 1 (B, KB, MB, etc..)
- decimal with the value in the above multiple
Implementing such struct is far from difficult but i'd rather use something from the framework
Below i paste a sample to better explain my intent
my draft proposal
public struct ByteUnit
{
public long ByteCount {get; set; }
public ByteMultiple Multiple {get; }
public decimal ByteCountInMultiple {get; }
}
Is there a framework type for such a thing?
Or doesn't it even make any sense and i am missing the big picture?