fix: improved text formatting in examples

This commit is contained in:
Mateusz Pusz
2024-04-19 16:49:27 +01:00
parent 41f500e729
commit 63f97d3396
4 changed files with 12 additions and 10 deletions

View File

@@ -58,7 +58,8 @@ struct Ship {
template<Unit auto... Us, Quantity Q>
auto fmt_line(const Q& q)
{
return MP_UNITS_STD_FMT::format("{:22}", q) + (MP_UNITS_STD_FMT::format(",{:20}", value_cast<Us>(q)) + ...);
return MP_UNITS_STD_FMT::format("{:22:N[.2f]}", q) +
(MP_UNITS_STD_FMT::format(",{:20:N[.2f]}", value_cast<Us>(q)) + ...);
}
// Print the ship details in the units as defined in the Ship struct, in other si::imperial units, and in SI