diff options
author | scorpion-26 <dev.scorpion26@gmail.com> | 2023-09-05 18:00:47 +0200 |
---|---|---|
committer | scorpion-26 <dev.scorpion26@gmail.com> | 2023-09-05 18:00:47 +0200 |
commit | f798acdaf71455684883df0ffb31d29293f788b2 (patch) | |
tree | 3e994cd34cf4497bd5f672b1604af8dd4cda7f8c | |
parent | 31be4362ce122182862ac338a9a479cde3a4c8e2 (diff) |
Fix short conversion of 1000-1023*iB
floating_humanizer([1000-1024], true) with base 8 returns "2K", whereas it should return
"1.0K" to align with other formats. The conversion is also broken for
all other units(e.g. 1023M is also broken and returns "2G")
-rw-r--r-- | src/btop_tools.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btop_tools.cpp b/src/btop_tools.cpp index e642ac6..f6be174 100644 --- a/src/btop_tools.cpp +++ b/src/btop_tools.cpp @@ -443,7 +443,7 @@ namespace Tools { out = to_string((int)round(stod(out))); } if (out.size() > 3) { - out = to_string((int)(out[0] - '0') + 1); + out = to_string((int)(out[0] - '0')) + ".0"; start++; } out.push_back(units[start][0]); |