MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / FormatByteSize

Function FormatByteSize

3rdparty/rainterface/RA_Interface.cpp:288–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286#ifndef RA_NOPROGRESS
287
288static void FormatByteSize(DWORD nSize, wchar_t* sBuffer, size_t nBufferSize)
289{
290 if (nSize < 1024)
291 {
292 swprintf_s(sBuffer, nBufferSize, L"%u bytes", nSize);
293 return;
294 }
295
296 float fSize = nSize;
297 fSize /= 1024.0;
298 if (fSize < 1024.0)
299 {
300 swprintf_s(sBuffer, nBufferSize, L"%.2f KB", fSize);
301 return;
302 }
303
304 fSize /= 1024.0;
305 swprintf_s(sBuffer, nBufferSize, L"%.2f MB", fSize);
306}
307
308static void SetProgressMessage(IProgressDialog* pProgressDialog, DWORD nProgress, DWORD nMax)
309{

Callers 1

SetProgressMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected