mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
modules/custom: Added percentage rounding
This commit is contained in:
parent
6c8e186586
commit
a4b1b0a211
@ -209,8 +209,8 @@ void waybar::modules::Custom::parseOutputJson() {
|
||||
class_.push_back(c.asString());
|
||||
}
|
||||
}
|
||||
if (!parsed["percentage"].asString().empty() && parsed["percentage"].isUInt()) {
|
||||
percentage_ = parsed["percentage"].asUInt();
|
||||
if (!parsed["percentage"].asString().empty() && parsed["percentage"].isNumeric()) {
|
||||
percentage_ = (int) lround(parsed["percentage"].asFloat());
|
||||
} else {
|
||||
percentage_ = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user