CSharp examples for System:Byte
Size To Readable String
public class Main{ public static string ToReadableString(this long size) {// w ww . j av a 2 s. co m if (size / 1000000L > 0L) { return (size / 10000L / 100.0).ToString() + "M"; } if (size / 1000L > 0L) { return (size / 10L / 100.0).ToString() + "K"; } return "< 1k"; } }