From: Sondre Wold Date: Tue, 16 Apr 2024 07:17:07 +0000 (+0200) Subject: Add formatting X-Git-Url: https://letsjmore.com/?a=commitdiff_plain;h=d9810be1f0e8ea588e5d847a2d8b29455bfcad69;p=weather_cli.git Add formatting --- 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); }