Closed ghost closed 5 years ago
This is not a bug, it's because you have food with bad data. You can't have more fiber than carbs. I am also aware that food in UK and other countries have fiber already removed, so this script isn't necessary. But if you mix them they are not going to work. Total Net Carbs as TNC = Total Carbs - Total Fibre is by definition.
I stand corrected, there indeed was a calculation bug (those pesky "net carb" entries in MFP, I hate them!). Pushed a fix.
Here is my modified version that fixes the Net Carbs calculation issue. It also keeps the Daily Goal and Remaining totals intact. MyFitnessPal Percentages and Net Carbs.user.js.txt
A few others have noticed that sometimes the Net Carbs total is incorrect. In the total row, it is calculating the Total Net Carbs as TNC = Total Carbs - Total Fibre:
But, as you can see from the image, this results in a negative value, which is obviously wrong.
I think a better calculation would be to simply sum the meal totals for Net Carbs:
This would also tally with the remaining value (5 in my image).
Daily Goal = 19 Net Carbs = 12 + 2 = 14 Remaining = 5
Can the script be updated to calculate the Total Net Carbs this way?