complete-javascript-course
complete-javascript-course copied to clipboard
Changing servings results in long floating numbers for newly added recipe ingredients
I noticed that when uploading a new recipe, everything works fine until I try to increase or decrease the number of servings. This causes strange and long floating numbers to appear in the recipe ingredients, which are linked to the servings value through a formula in our code.
It seems the fractional library isn’t being applied to these new recipes, although the rest of the recipes fetched from the API work fine.
My final code looks almost as same as Jonas in the controller.js and model.js files.
Any help is appreciated!