Properly format the bytes during download

This commit is contained in:
Kawe Mazidjatari 2023-07-31 18:42:40 +02:00
parent b5d9977e5d
commit 2a4ff1fe51

View File

@ -268,7 +268,8 @@ int SDKLauncher_ProgressCallback(CURLProgress* progessData, double dltotal,
double downloaded; double downloaded;
curl_easy_getinfo(progessData->curl, CURLINFO_SIZE_DOWNLOAD, &downloaded); curl_easy_getinfo(progessData->curl, CURLINFO_SIZE_DOWNLOAD, &downloaded);
pDownloadSurface->SetExportLabel(Format("%s (%llu of %llu)", progessData->name, (size_t)downloaded, progessData->size).c_str()); pDownloadSurface->SetExportLabel(Format("%s (%s of %s)", progessData->name,
FormatBytes((size_t)downloaded).c_str(), FormatBytes(progessData->size).c_str()).c_str());
size_t percentage = ((size_t)downloaded * 100) / progessData->size; size_t percentage = ((size_t)downloaded * 100) / progessData->size;
pDownloadSurface->UpdateProgress((uint32_t)percentage, false); pDownloadSurface->UpdateProgress((uint32_t)percentage, false);