Open OJFord opened 2 years ago
I wasn't aware of the difference between an US teaspoon and metric teaspoon and just used the NIST reference. The hardest part of adding a metric tea/tablespoon will be deciding on the names. I'm not against breaking compatibility in general, but I'm hesitant in this case because the effect would be very subtle so I'm leaning towards something like teaspoon_metric
.
For reference I live in the US and decided to use the US option when one must be chosen.
Interesting, I wonder why it's missing there when it seems so complete otherwise.
Maybe a good general (& backwards-compatible) solution is to always suffix them when there's any ambiguity? i.e. _metric
, _us
, _imperial
in all such cases; deprecating the unsuffixed version?
(Just looking at that doc, the same occurs with 'cups', US/metric/old British cups are each slightly different. Though that's less likely to ever cause an issue, since cups are so much less used outside the US.)
I think your idea of using the suffixes + deprecation is the way to go. PRs welcome, even if just for the specific _metric
or _imperial
units you're looking for. Not sure how soon I'll be able to dig in to this.
Sounds good, will have a look this weekend. Thanks!
I suppose
fluid_ounce
being US (vs.fluid_ounce_imperial
not) is fair enough, I might be inclined to do the opposite being British.In the case of
teaspoon
&tablespoon
though I think it's confusing - as far as I know the standard measurement is metric: 5ml & 15ml respectively.This doesn't exist in
uom::si
, nor doesteaspoon_imperial
ortablespoon_imperial
(the former 1/3 of the latter, as in the US ones, andtablespoon_imperial
5/8 of afluid_ounce_imperial
, unlike the US one at 1/2) which might hint at them not being metric at least.IMO
teaspoon
andtablespoon
should be metric, and US/imperial variants should all be suffixed if they're to be provided.