ui: Improved byte selection text

This commit is contained in:
WerWolv
2022-06-30 11:29:20 +02:00
parent 3efdc02fed
commit 034cc0cd2f
2 changed files with 8 additions and 3 deletions

View File

@@ -78,11 +78,16 @@ namespace hex {
break;
}
std::string result = hex::format("{0:.2f}", value);
std::string result;
if (unitIndex == 0)
result = hex::format("{0:}", value);
else
result = hex::format("{0:.2f}", value);
switch (unitIndex) {
case 0:
result += " Bytes";
result += ((value == 1) ? " Byte" : " Bytes");
break;
case 1:
result += " kB";