diff --git a/lib/libimhex/source/helpers/utils.cpp b/lib/libimhex/source/helpers/utils.cpp index c08a46132..da76ecc08 100644 --- a/lib/libimhex/source/helpers/utils.cpp +++ b/lib/libimhex/source/helpers/utils.cpp @@ -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"; diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index b6215d110..1da836865 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -967,7 +967,7 @@ namespace hex::plugin::builtin { auto selection = this->getSelection(); std::string value; if (this->isSelectionValid()) - value = hex::format("0x{0:08X} - 0x{1:08X} ({0} - {1}) ({2} {3})", selection.getStartAddress(), selection.getEndAddress(), selection.getSize(), selection.getSize() == 1 ? "Byte" : "Bytes"); + value = hex::format("0x{0:08X} - 0x{1:08X} ({2})", selection.getStartAddress(), selection.getEndAddress(), hex::toByteString(selection.getSize())); else value = std::string("hex.builtin.view.hex_editor.selection.none"_lang);