Show battery state as rounded number

Round the battery charge state so that 99.9% shows as 100%.
This commit is contained in:
Pedro Côrte-Real 2020-11-26 02:20:53 +00:00
parent e0cdcb6e30
commit eb3f4216d4
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ const std::tuple<uint8_t, float, std::string> waybar::modules::Battery::getInfos
capacity = 100.f;
status = "Full";
}
return {capacity, time_remaining, status};
return {round(capacity), time_remaining, status};
} catch (const std::exception& e) {
spdlog::error("Battery: {}", e.what());
return {0, 0, "Unknown"};