MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / FormatSizeText

Function FormatSizeText

Telegram/SourceFiles/ui/text/format_values.cpp:54–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52} // namespace
53
54QString FormatSizeText(qint64 size) {
55 if (size >= 1024 * 1024) { // more than 1 mb
56 const qint64 sizeTenthMb = (size * 10 / (1024 * 1024));
57 return QString::number(sizeTenthMb / 10)
58 + '.'
59 + QString::number(sizeTenthMb % 10) + u" MB"_q;
60 }
61 if (size >= 1024) {
62 const qint64 sizeTenthKb = (size * 10 / 1024);
63 return QString::number(sizeTenthKb / 10)
64 + '.'
65 + QString::number(sizeTenthKb % 10) + u" KB"_q;
66 }
67 return QString::number(size) + u" B"_q;
68}
69
70QString FormatDownloadText(qint64 ready, qint64 total) {
71 return FormatTextWithReadyAndTotal(

Callers 15

updateDocSizeMethod · 0.85
setStatusSizeMethod · 0.85
BackgroundSelectorMethod · 0.85
RingtonesBoxFunction · 0.85
StateDescriptionFunction · 0.85
FormatStorageSizeFunction · 0.85
sizeTextMethod · 0.85
updateClearButtonMethod · 0.85
finishClearingMethod · 0.85
refreshMethod · 0.85
preparePreviewMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected