Also calculate the sugar contents for meals

This commit is contained in:
Roland Geider
2021-03-31 14:34:07 +02:00
parent ab5226a7a4
commit 23c277c54c
2 changed files with 5 additions and 12 deletions

View File

@@ -90,19 +90,11 @@ class Log {
out.energy = ingredientObj.energy * weight / 100;
out.protein = ingredientObj.protein * weight / 100;
out.carbohydrates = ingredientObj.carbohydrates * weight / 100;
out.carbohydratesSugar = ingredientObj.carbohydratesSugar * weight / 100;
out.fat = ingredientObj.fat * weight / 100;
if (ingredientObj.fatSaturated != null) {
out.fatSaturated = ingredientObj.fatSaturated * weight / 100;
}
if (ingredientObj.fibres != null) {
out.fibres = ingredientObj.fibres * weight / 100;
}
if (ingredientObj.sodium != null) {
out.sodium = ingredientObj.sodium * weight / 100;
}
out.fatSaturated = ingredientObj.fatSaturated * weight / 100;
out.fibres = ingredientObj.fibres * weight / 100;
out.sodium = ingredientObj.sodium * weight / 100;
return out;
}

View File

@@ -81,6 +81,7 @@ class MealItem {
out.energy = ingredientObj.energy * weight / 100;
out.protein = ingredientObj.protein * weight / 100;
out.carbohydrates = ingredientObj.carbohydrates * weight / 100;
out.carbohydratesSugar = ingredientObj.carbohydratesSugar * weight / 100;
out.fat = ingredientObj.fat * weight / 100;
out.fatSaturated = ingredientObj.fatSaturated * weight / 100;
out.fibres = ingredientObj.fibres * weight / 100;