nholthaus / units

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
http://nholthaus.github.io/units/
MIT License
947 stars 135 forks source link

[QoL] "tonne" over "metric ton" #221

Open parnmatt opened 5 years ago

parnmatt commented 5 years ago

You have the metric unit equal to 1000 kg labelled as "metric ton".

https://github.com/nholthaus/units/blob/master/include/units.h#L3385

This unit, though commonly referred to as a "metric ton" (to be consistent with "short ton" and "long ton") in the US; the actual spelling of the unit (and what the majority of the world will call it) is "tonne".

https://en.wikipedia.org/wiki/Tonne

As this library doesn't support std::istream, but does support std::ostream and this naming only will appear if requested; would it be possible to add an alias name (presuming some idiot is actually relying on the literally "metric_ton" and/or "metric_tons", rather than the unit or tag).

Alternatively, adding preprocessor macros around this and potentially other units. USE_INTERNATIONAL_SPELLING; which would use "tonne" and if disabled, use "metric ton" ... or equivalent. (defaulting to undefined, for the above compatibility)