36 static const long kB = 1024L;
37 static const long lMB = kB * kB;
38 static const long lGB = lMB * kB;
42 else if(bytes < (10L * kB))
43 ss << setprecision(2) << ((
double)bytes / (
float)kB) <<
" kB";
44 else if(bytes < (100L * kB))
45 ss << setprecision(1) << ((
double)bytes / (
float)kB) <<
" kB";
47 ss << setprecision(0) << ((
double)bytes / (
float)kB) <<
" kB";
48 else if(bytes < (10L * lMB))
49 ss << setprecision(2) << ((
double)bytes / (
float)lMB) <<
" MB";
50 else if(bytes < (100L * lMB))
51 ss << setprecision(1) << ((
double)bytes / (
float)lMB) <<
" MB";
53 ss << setprecision(0) << ((
double)bytes / (
float)lMB) <<
" MB";
55 ss << setprecision(2) << ((
double)bytes / (
float)lGB) <<
" GB";
std::string dig2bytes(Long64_t bytes)
This function creates a string representation of the number of bytes, represented as a number in B,...