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); }
public string ToLongString(ByteUnit unit, string format) { return($"{this[unit].ToString(format)} {unit.GetInfo().Suffix}"); }
public string ToLongString(ByteUnit unit) { return($"{this[unit]} {unit.GetInfo().Suffix}"); }