String Formatting
Source: https://doc.rust-lang.org/std/fmt/
Precision π
Source: https://doc.rust-lang.org/std/fmt/#precision
let x = 0.01;
println!("Hello x is {x:.5}");
Prints: βHello x is 0.01000β
Fill/Alignment π
Source: https://doc.rust-lang.org/std/fmt/#fillalignment
let hours = 3;
println!("{hours:0>2}:25")
Prints: β03:25β
Pretty Printing π
Source: https://doc.rust-lang.org/std/fmt/#sign0
β#?β - pretty-print the Debug formatting (adds line breaks and indentation)
format!("{:#?}", (100, 200)); // => "(
// 100,
// 200,
// )"