nutritionix / nutrition-label

Create a FDA-style nutrition label with any nutrition data source (even the Nutritionix API - http://www.nutritionix.com/api)
http://www.nutritionix.com/
MIT License
176 stars 66 forks source link

2018 label bug - there is a serving unit quantity value on the label that should not be there #122

Closed majin22 closed 4 years ago

majin22 commented 4 years ago

found this while working on #121

one one of the demo (will be added after task #121 is done), there is an extra serving unit quantity value when this code is used

$('#test7').nutritionLabel({
    showServingUnitQuantityTextbox : false,
    showServingWeightGrams : false,
    showIngredients : false,
    showServingsPerContainer : false,
    showItemName : false,

    textServingSize : 'Serving Size 6.96 10-inch pizza (3.7819g grams)',

    valueServingUnitQuantity : 9.3,

    showPolyFat : false,
    showMonoFat : false,
    showTransFat : false,
    showFibers : false,
    showVitaminD : false,
    showVitaminC : false,
    showCalcium : false,
    showIron : false,
    showCaffeine : false,

    valueCalories : 400,
    valueFatCalories : 220,
    valueTotalFat : 24,
    valueSatFat : 15,
    valueCholesterol : 25,
    valueSodium : 430,
    valueTotalCarb : 44,
    valueSugars : 24,
    valueProteins : 4,
    valueVitaminD : 12.22,
    valuePotassium_2018 : 4.22,
    valueCalcium : 7.22,
    valueIron : 11.22,
    showLegacyVersion : false
});

2018 Version Demo Page

cc @Yurko-Fedoriv to keep him informed

majin22 commented 4 years ago

this is not really a bug as the test value is meant to be Serving size: so if this was used normally, it will show as Serving size: 9.3

so the problem is how we used this on the legacy desktop calculator of Nutritionix so we need different solution for this but this is not really a bug

cc @Yurko-Fedoriv to keep him informed