falk-hueffner / metric-cooking

Browser script that annotates US cooking units with their metric equivalent (e.g. 1 3/4 cups sugar [350 g])
GNU General Public License v2.0
29 stars 4 forks source link

1 pound = 450g, but 1½ pounds = 700g (?) #21

Closed diamondavocado closed 2 years ago

diamondavocado commented 2 years ago

On this recipe: https://persianmama.com/kabob-koobideh-grilled-minced-meat-kabobs/

The converted output reads:

1 ½ pounds [700 g] ground beef (80-85% lean) 1 pound [450 g] ground lamb (80-85% lean)

That is obviously wrong. If 1 lb is 450g then 1.5 lbs is 675g, not 700.

falk-hueffner commented 2 years ago

This comes from rounding. 1 pound is 453.592g and 1½ pounds is 680.389g. Since you don't want to read something like "453.592g", the extension rounds this to nicer reading numbers, accepting up to 3% error. This will unfortunately necessarily introduce the kinds of inconsistencies you're seeing, since we're sometimes rounding up and sometimes rounding down.

falk-hueffner commented 2 years ago

Closing since this can't be avoided with the current design.