Skip to content

Commit

Permalink
Fix short conversion of 1000-1023*iB
Browse files Browse the repository at this point in the history
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")
  • Loading branch information
scorpion-26 committed Sep 5, 2023
1 parent 31be436 commit f798acd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/btop_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit f798acd

Please sign in to comment.