Jump to content

Nutrients handling in Open Food Facts: Difference between revisions

Added default unit
(Added value examples)
(Added default unit)
Line 43: Line 43:
* nutrient-id_value : what was passed in the nutrient-id field
* nutrient-id_value : what was passed in the nutrient-id field
* nutrient-id_unit : what was passed in the nutrient-id_unit field
* nutrient-id_unit : what was passed in the nutrient-id_unit field
* nutrient-id : the value converted in the default unit (currently kJ for all energy fields, including energy-kcal)
* nutrient-id : the value converted in the default unit (currently kJ for all energy fields (including energy-kcal), otherwise gram)
* nutrient-id_[value of nutrition_data_per) is set to nutrient-id (e.g. if nutrition_data_per is "100g", the value of sugars_100g is set to the value of sugars
* nutrient-id_[value of nutrition_data_per) is set to nutrient-id (e.g. if nutrition_data_per is "100g", the value of sugars_100g is set to the value of sugars
* if the serving size is known, we compute the value for the other field (nutrient-id_100g or nutrient-id_serving)
* if the serving size is known, we compute the value for the other field (nutrient-id_100g or nutrient-id_serving) in default unit


=== Data display ===
=== Data display ===
3,543

edits