From ecb4c6a873ae304562a86d19601efbadb99f2884 Mon Sep 17 00:00:00 2001 From: forkless Date: Mon, 1 Jun 2026 03:21:05 +0200 Subject: [PATCH] Zero-pad playtime to 2 digits --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index da03791..25d8873 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1209,11 +1209,11 @@ fn format_playtime(seconds: Option) -> String { Some(s) if s >= 3600.0 => { let h = (s / 3600.0) as u32; let m = ((s % 3600.0) / 60.0) as u32; - format!("{h}h {m}m") + format!("{h:02}h {m:02}m") } Some(s) if s >= 60.0 => { let m = (s / 60.0) as u32; - format!("{m}m") + format!(" {m:02}m") } Some(_) => String::from("—"), None => String::from("—"),