static string toLocaleBytes(long b) { if (b < KB) { return(b + "B"); } if (b < 10 * KB) { return(FanFloat.toLocale((double)b / KB, "#.#") + "KB"); } if (b < MB) { return(Math.Round((double)b / KB) + "KB"); } if (b < 10 * MB) { return(FanFloat.toLocale((double)b / MB, "#.#") + "MB"); } if (b < GB) { return(Math.Round((double)b / MB) + "MB"); } if (b < 10 * GB) { return(FanFloat.toLocale((double)b / GB, "#.#") + "GB"); } return(Math.Round((double)b / GB) + "GB"); }
public static Double toFloat(string self, bool check) { return(FanFloat.fromStr(self, check)); }
public static Double toFloat(string self) { return(FanFloat.fromStr(self, true)); }