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

Option to convert in metric systems #4

Open
tollerm opened this issue Mar 4, 2018 · 2 comments
Open

Option to convert in metric systems #4

tollerm opened this issue Mar 4, 2018 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@tollerm
Copy link

tollerm commented Mar 4, 2018

It would be nice to add an option to convert from american units like cups, pounds, ounces etc. into metric measurements such as liters, grams etc..

@Chobbes
Copy link
Owner

Chobbes commented Mar 4, 2018

I would love to add a feature like this! I have thought a little bit about this, but there are some issues that I would have to sort out first.

It would be really nice if it could automatically convert for you, but maybe that's a bit dangerous because I don't think it can be perfect (though, it can probably be pretty good).

  1. Probably going to need something to actually parse the ingredients... Right now I just grab them as strings.
    • Lots of different forms that this can take... 1 - 2 tbsp, 1 1/2 tbsp, 1 - 1/2 tbsp, 1 + 1/2 tbsp... Who knows, the real world is a messy place.
  2. I think ounces can be somewhat ambiguous -- either it's fluid ounces or weight ounces, and I don't think this is always distinguished by something like "fl. oz"... Need to know what an ingredient is.
  3. Converting to weights needs to know the density of ingredients if it's measured by volume normally

For (2), I'm welcome to any suggestions for how to distinguish between "liquid" ingredients and "by weight" ingredients (maybe we just ask when it's ambiguous, and try to make a list of them)....

For (3), I am also welcome to suggestions for how to get conversions from volume to weight.

I know you might just want to convert cups and whatnot to ml, but I think it would also be nice to be able to convert all recipes to recipes by weight!

Also! Might be worth seeing if there is an elisp library for handling unit conversions, and if not maybe making one?

@Chobbes Chobbes added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Mar 4, 2018
@egh
Copy link
Contributor

egh commented Mar 27, 2018

You can use emacs calc to do a lot of this. See https://gitlab.com/egh/org-cook/tree/master for how it can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants