cookbook
cookbook copied to clipboard
Automatically round ingredient amounts to useful precision
Description Recipe pulled from URL shows long floating point values for ingredients
Reproduction Steps to reproduce the behavior:
- add recipe from URL: https://www.allrecipes.com/recipe/246195/chef-johns-homemade-eggnog/
Expected behavior Should either display "0.3 Cups" or "1/3 Cup" for sugar
Actual behavior Ingredients list shows 0.33333334326744 cups of sugar
Screenshots
Browser 1.46.144 Chromium: 108.0.5359.128 (Official Build) (64-bit)
Versions Nextcloud server version: 25.0.2 Cookbook version: 0.10.1 Database system: MySQL
Depends on #116
Sorry - after further investigation (surely, right after hitting 'submit') I found the embedded schema on the page, which is the source for the float value. My bad.
"recipeIngredient": [
"0.33333334326744 cup white sugar",
I reopen this issue as a rounding feature for all recipes or all ingredients of one recipe might be something useful. However, we need to split the ingredients into numbers, units, etc in order to do calculations with the values.