mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix round to 0 or 1 in capacity computation with given full-at
This commit is contained in:
parent
b18262f6d0
commit
df0d34dbd4
@ -119,7 +119,7 @@ const std::tuple<uint8_t, float, std::string> waybar::modules::Battery::getInfos
|
|||||||
if (config_["full-at"].isUInt()) {
|
if (config_["full-at"].isUInt()) {
|
||||||
auto full_at = config_["full-at"].asUInt();
|
auto full_at = config_["full-at"].asUInt();
|
||||||
if (full_at < 100) {
|
if (full_at < 100) {
|
||||||
capacity = static_cast<float>(capacity / full_at) * 100;
|
capacity = 100.f * capacity / full_at;
|
||||||
if (capacity > full_at) {
|
if (capacity > full_at) {
|
||||||
capacity = full_at;
|
capacity = full_at;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user