Merge pull request #1444 from bd-g/feat/cpu-load-fix

CPU Load Formatting Fix
This commit is contained in:
Alex 2022-02-23 09:12:53 +01:00 committed by GitHub
commit 91339f6ad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 waybar::modules::Cpu::getCpuLoad() {
double load[1]; double load[1];
if (getloadavg(load, 1) != -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"); throw std::runtime_error("Can't get Cpu load");
} }