18 #include "MemoryInfo.h"
20 String & MemoryInfo(
double bytes)
25 return info =
"<1.0 kb";
27 if (bytes < 1024. * 1024.)
28 info.printf(
"%.1f kb", (bytes + 1023) / 1024.);
29 else if (bytes < 1024. * 1024. * 1024.)
30 info.printf(
"%.1f mb", (bytes + 1024. * 1024. - 1) / (1024. * 1024.));
31 else if (bytes < 1024. * 1024. * 1024. * 1024.)
32 info.printf(
"%.1f gb", bytes / (1024. * 1024. * 1024.));
34 info.printf(
"%.1f tb", bytes / (1024. * 1024. * 1024. * 1024.));