MCPcopy Create free account
hub / github.com/c3d/tao3D / bytesToText

Function bytesToText

tao/texture_cache.cpp:45–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45static text bytesToText(quint64 size)
46// ----------------------------------------------------------------------------
47// Convert size in bytes into a human readable string
48// ----------------------------------------------------------------------------
49{
50 if (size == CACHE_UNLIMITED)
51 return +QString("unlimited");
52 if (size < CACHE_KB)
53 return +QString("%1 B").arg(size);
54 else if (size < CACHE_MB)
55 return +QString("%1 KiB").arg((double)size/CACHE_KB, 0, 'f', 2);
56 else if (size < CACHE_GB)
57 return +QString("%1 MiB").arg((double)size/CACHE_MB, 0, 'f', 2);
58 else
59 return +QString("%1 GiB").arg((double)size/CACHE_GB, 0, 'f', 2);
60}
61
62
63// ----------------------------------------------------------------------------

Callers 6

doPrintStatisticsMethod · 0.85
IFTRACE2Function · 0.85
unloadMethod · 0.85
IFTRACEFunction · 0.85
transferMethod · 0.85
purgeGLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected