MCPcopy Create free account
hub / github.com/Faster3ck/Converseen / simplifyFileSize

Method simplifyFileSize

src/sizeutil.cpp:26–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "sizeutil.h"
25
26QString SizeUtil::simplifyFileSize(qint64 size)
27{
28 QString sSize;
29
30 sSize = QString("%1 Bytes").arg(size);
31 if (size > 1024)
32 sSize = QString("%1 KiB").arg(QString::number( ((double)size / 1024), 'f', 1) );
33 if (size / 1024 > 1024)
34 sSize = QString("%1 MiB").arg(QString::number( ((double)size / 1024 / 1024), 'f', 1) );
35
36 return sSize;
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected