WIP: Script-Creator!

This commit is contained in:
StackZ
2020-06-21 16:41:48 +02:00
parent 984d363533
commit 91615d7891
8 changed files with 131 additions and 155 deletions
+3 -3
View File
@@ -29,11 +29,11 @@
// adapted from GM9i's byte parsing.
std::string formatBytes(int bytes) {
char out[32];
if(bytes == 1)
if (bytes == 1)
snprintf(out, sizeof(out), "%d Byte", bytes);
else if(bytes < 1024)
else if (bytes < 1024)
snprintf(out, sizeof(out), "%d Bytes", bytes);
else if(bytes < 1024 * 1024)
else if (bytes < 1024 * 1024)
snprintf(out, sizeof(out), "%.1f KB", (float)bytes / 1024);
else if (bytes < 1024 * 1024 * 1024)
snprintf(out, sizeof(out), "%.1f MB", (float)bytes / 1024 / 1024);