units
units copied to clipboard
Better output of compound units?
In v3.0.0.alpha-2, this
auto P = 1_MPa;
std::cout << P << '\n';
gives
1e+06 m^-1 kg s^-2
. Wouldn't something like
std::cout << P.value () << ' ' << abbreviation (P) << '\n';
that produces
1 MPa
be preferable ?
Seems like a bug that it doesn't print the latter. If it has an UDL, then the abbreviation should be printed. But your output suggests that the streaming operator for ephemeral units is being used.
definitely a bug.
Seems like #146 and this were fixed by #167, so in the v3.x branch the output is as expected. -- https://github.com/nholthaus/units/issues/195#issuecomment-429398567