rust-embedded-community/rust-measurements

Can 'impl Display' take precision arguments?

thejpster opened this issue · 4 comments

It would be nice if println!("{0.3}", temp) gave "0.000°C". I have no idea if this is possible.

I'm going to have a look at this one.

See the precision branch for work in progress.

I can pull width and decimal places, but not padding. Surely there's a way to pass the whole args variable to write.

Ah. It's easy when you know how.
Call v.fmt(f), for some value v.
Fixed in weight_and_mass branch.