Trying to replicate the following C printf invocation
printf("%6.1f %6.1f %6.1f\n", x, y, z);
in rust and I can't find it in the docs. I need 6 positions wide with 1 decimal place.
First time I've been stumped finding what I need there.
Formatting strings are documented in the documentation for std::fmt
.
The equivalent of %6.1f
would be {:6.1}
:
println!("{:6.1} {:6.1} {:6.1}", x, y, z);