MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / BytesToFormat

Function BytesToFormat

AdaptixClient/Source/Utils/Convert.cpp:273–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273QString BytesToFormat(qint64 bytes)
274{
275 constexpr double KB = 1024.0;
276 constexpr double MB = KB * 1024;
277 constexpr double GB = MB * 1024;
278
279 if (bytes >= GB) {
280 return QString::number(bytes / GB, 'f', 2) + " Gb";
281 } else if (bytes >= MB) {
282 return QString::number(bytes / MB, 'f', 2) + " Mb";
283 } else {
284 return QString::number(bytes / KB, 'f', 2) + " Kb";
285 }
286}
287
288QIcon RecolorIcon(QIcon originalIcon, const QString &colorString)
289{

Callers 3

dataMethod · 0.85
updateFileDataMethod · 0.85
format_sizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected