mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-20 01:42:38 +02:00
modules/custom: Added percentage rounding
This commit is contained in:
@@ -209,8 +209,8 @@ void waybar::modules::Custom::parseOutputJson() {
|
|||||||
class_.push_back(c.asString());
|
class_.push_back(c.asString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!parsed["percentage"].asString().empty() && parsed["percentage"].isUInt()) {
|
if (!parsed["percentage"].asString().empty() && parsed["percentage"].isNumeric()) {
|
||||||
percentage_ = parsed["percentage"].asUInt();
|
percentage_ = (int) lround(parsed["percentage"].asFloat());
|
||||||
} else {
|
} else {
|
||||||
percentage_ = 0;
|
percentage_ = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user