Beispiel #1
0
        public static decimal GetFactor(this ByteUnit unit)
        {
            var power  = unit.GetInfo().Power;
            var factor = 1M;

            if (power > 0)
            {
                for (var i = 0; i < power; i++)
                {
                    factor *= 1024;
                }
            }
            return(factor);
        }
Beispiel #2
0
 public string ToLongString(ByteUnit unit, string format)
 {
     return($"{this[unit].ToString(format)} {unit.GetInfo().Suffix}");
 }
Beispiel #3
0
 public string ToLongString(ByteUnit unit)
 {
     return($"{this[unit]} {unit.GetInfo().Suffix}");
 }