limit cpu load figure to 2 points

This commit is contained in:
Brent George 2022-02-22 16:33:33 -07:00
parent ad5ea7ad2b
commit 3c18c43b9a
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ auto waybar::modules::Cpu::update() -> void {
double waybar::modules::Cpu::getCpuLoad() {
double load[1];
if (getloadavg(load, 1) != -1) {
return load[0];
return std::ceil(load[0] * 100.0) / 100.0;
}
throw std::runtime_error("Can't get Cpu load");
}