mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Some, uhh.. changes?
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
* Copyright (C) 2019-2020 Universal-Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -29,16 +29,17 @@
|
||||
// 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)
|
||||
} else if (bytes < 1024 * 1024 * 1024) {
|
||||
snprintf(out, sizeof(out), "%.1f MB", (float)bytes / 1024 / 1024);
|
||||
else
|
||||
} else {
|
||||
snprintf(out, sizeof(out), "%.1f GB", (float)bytes / 1024 / 1024 / 1024);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user