mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-10 14:34:41 +12:00
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")
This commit is contained in:
parent
31be4362ce
commit
f798acdaf7
|
@ -443,7 +443,7 @@ namespace Tools {
|
||||||
out = to_string((int)round(stod(out)));
|
out = to_string((int)round(stod(out)));
|
||||||
}
|
}
|
||||||
if (out.size() > 3) {
|
if (out.size() > 3) {
|
||||||
out = to_string((int)(out[0] - '0') + 1);
|
out = to_string((int)(out[0] - '0')) + ".0";
|
||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
out.push_back(units[start][0]);
|
out.push_back(units[start][0]);
|
||||||
|
|
Loading…
Reference in a new issue