From f9c01f54d23c2256f5a6fad5382544365cca6114 Mon Sep 17 00:00:00 2001 From: patrulhasirius Date: Thu, 29 Aug 2024 15:59:54 -0300 Subject: [PATCH] fix(battery): too many decimals in battery percent Co-authored-by: Lucas Ribeiro --- cosmic-applet-battery/src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmic-applet-battery/src/app.rs b/cosmic-applet-battery/src/app.rs index 05074bd9..0cb58cc0 100644 --- a/cosmic-applet-battery/src/app.rs +++ b/cosmic-applet-battery/src/app.rs @@ -430,7 +430,7 @@ impl cosmic::Application for CosmicBatteryApplet { fn view_window(&self, _id: window::Id) -> Element { let name = text(fl!("battery")).size(14); let description = text(if !self.on_battery { - format!("{}%", self.battery_percent) + format!("{:.0}%", self.battery_percent) } else { format!( "{} {} ({:.0}%)",