Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

US and metric cooking units #1449

Closed
charmanjoe opened this issue Mar 21, 2019 · 6 comments
Closed

US and metric cooking units #1449

charmanjoe opened this issue Mar 21, 2019 · 6 comments

Comments

@charmanjoe
Copy link

Some units are in metric while others are in US units. For example:
math.unit(1,"cup").toNumber("tablespoon")
15.772546666666665
From here, a US legal cup is 240 mL, while a US customary cup is 236.5882365 mL.
From here, a metric tablespoon is 15 mL, while a US tablespoon is approximately 14.8 mL.
From my example, it seems like it uses a US customary cup and a metric tablespoon.
Please include the option for US units.

@josdejong
Copy link
Owner

Hm yes you're right, we should change the value of tablespoon to ~14.8 mL to make it consistent with cup. And probably create new units for the other variants of the units.

@charmanjoe
Copy link
Author

Here is a list of the United States Customary Units.

@josdejong
Copy link
Owner

Who's interested in fixing the these units?

It will be a breaking change so we'll have to schedule it for v6

@codingedgar
Copy link

I haven't found anything that solves the US system, Imperial, Metric differences of cup, Tbs etc well, same issue happens in measuring-cup. The need of

  1. Transform between systems (US, Imperial, Metric, etc)
  2. Transform between units (cup of sugar -> g of sugar)

Are very common use cases for cooking, (the 2nd point is a total different issue, but would be amazing to have something to do it)

@ericman314
Copy link
Collaborator

I've been working (very slowly) on migrating all the units functions from math.js into their own library. Would you mind raising this issue over at https://github.com/ericman314/UnitMath/issues ? That way I will not forget about it. I imagine that this might be something we could address with a configuration option to choose between the various types of cups, etc, or have units with suffixes such as cupImperial, with an alias of cup, depending on the configuration option.

@gwhitney
Copy link
Collaborator

gwhitney commented Oct 6, 2023

Since this is recorded over at UnitMath, closing it here (as it is more likely to be resolved over there than here, I'd say).

@gwhitney gwhitney closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants