Show battery state as rounded number
Round the battery charge state so that 99.9% shows as 100%.pull/923/head
parent
e0cdcb6e30
commit
eb3f4216d4
|
@ -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"};
|
||||
|
|
Loading…
Reference in New Issue