MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / formatBytes

Function formatBytes

src/qt/guiutil.cpp:818–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818QString formatBytes(uint64_t bytes)
819{
820 if (bytes < 1'000)
821 return QObject::tr("%1 B").arg(bytes);
822 if (bytes < 1'000'000)
823 return QObject::tr("%1 kB").arg(bytes / 1'000);
824 if (bytes < 1'000'000'000)
825 return QObject::tr("%1 MB").arg(bytes / 1'000'000);
826
827 return QObject::tr("%1 GB").arg(bytes / 1'000'000'000);
828}
829
830qreal calculateIdealFontSize(int width, const QString& text, QFont font, qreal minPointSize, qreal font_size) {
831 while(font_size >= minPointSize) {

Callers 3

dataMethod · 0.85
updateTrafficStatsMethod · 0.85
updateDetailWidgetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected