From d9810be1f0e8ea588e5d847a2d8b29455bfcad69 Mon Sep 17 00:00:00 2001 From: Sondre Wold Date: Tue, 16 Apr 2024 09:17:07 +0200 Subject: [PATCH] Add formatting --- weather_cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weather_cli/src/main.rs b/weather_cli/src/main.rs index 2c27187..737c38b 100644 --- a/weather_cli/src/main.rs +++ b/weather_cli/src/main.rs @@ -139,8 +139,8 @@ fn main() { } let avg = temperatures / hours as f32; println!( - "Average temperature for the next {} hour(s) is going to be {}", + "Average temperature for the next {} hour(s) is going to be {:.2}", hours, avg ); - println!("Total precipation: {}", rain); + println!("Total precipation: {:.2}", rain); } -- 2.39.5