From 136b47ce0d84df665349973140a0e5746c9d3e23 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 15 Mar 2022 23:03:13 +0100 Subject: [PATCH] Fixed percentage not getting rounded --- src/modules/upower.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/upower.cpp b/src/modules/upower.cpp index abcfa94..c688777 100644 --- a/src/modules/upower.cpp +++ b/src/modules/upower.cpp @@ -177,7 +177,7 @@ auto UPower::update() -> void { // Set percentage std::string percent_string = - displayDeviceValid ? std::to_string(int(percentage) + 0.5) + "%" : ""; + displayDeviceValid ? std::to_string(int(percentage + 0.5)) + "%" : ""; label_.set_text(percent_string); // Set icon