Merge pull request #1944 from PolpOnline/master

This commit is contained in:
Alex 2023-01-23 09:22:27 +01:00 committed by GitHub
commit 5182fadede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}