摘要: public static string humanReadableByteCount(long bytes) { int unit = 1024; if (bytes < unit) return bytes + " B"; int exp = (int)(Math.Log(bytes) / Math.Log(unit)); return String.Format("{0:F1} {1}B", bytes / Math.Pow(unit, exp), "KMGTPE"[exp - 1]); }将Byte数转为其他单... 阅读全文
posted @ 2012-09-18 22:52 gitran 阅读(151) 评论(0) 推荐(0) 编辑