fix(battery): too many decimals in battery percent

Co-authored-by: Lucas Ribeiro <estg-lnr@tce.rs.gov.br>
This commit is contained in:
patrulhasirius 2024-08-29 15:59:54 -03:00 committed by GitHub
parent 53848e4201
commit f9c01f54d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -430,7 +430,7 @@ impl cosmic::Application for CosmicBatteryApplet {
fn view_window(&self, _id: window::Id) -> Element<Message> {
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}%)",