From f85d9b4910bbc1fb1503337a8ebdc6a5c72c4418 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 14 Dec 2023 01:21:13 +0000 Subject: [PATCH] Fix padding in internet time --- src/tiles/internet_time.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tiles/internet_time.rs b/src/tiles/internet_time.rs index d4a3d3d..f60070e 100644 --- a/src/tiles/internet_time.rs +++ b/src/tiles/internet_time.rs @@ -19,8 +19,10 @@ pub async fn internet_time_stream(config: InternetTimeConfig) { let internet_time = seconds / 86.4; yield Ok(Block { full_text: format!( - "@{time:03.prec$}", + "@{time:0width$.prec$}", time = internet_time, + // 3 digits + and decimal point + width = config.precision as usize + 4, prec = config.precision as usize ) .into_boxed_str(),