]> git.sondrewold.no Git - weather_cli.git/commitdiff
Add formatting
authorSondre Wold <[email protected]>
Tue, 16 Apr 2024 07:17:07 +0000 (09:17 +0200)
committerSondre Wold <[email protected]>
Tue, 16 Apr 2024 07:17:07 +0000 (09:17 +0200)
weather_cli/src/main.rs

index 2c27187d0e75094734322f2c88054e430fe21329..737c38b01a10dce8b2b3fbd69c238da6f7019534 100644 (file)
@@ -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);
 }