Round values for an FDA Nutrition Facts label
round_nutrition_labelApplies the FDA Nutrition Facts rounding rules from 21 CFR 101.9(c) to unrounded per-serving values: calories (under 5 = 0, nearest 5 up to 50, nearest 10 above), fat and saturated fat (nearest 0.5 g under 5 g), sodium (nearest 5 mg up to 140 mg, nearest 10 above), carbohydrate, fiber, sugars, added sugars and protein (nearest gram, "less than 1g" rules). Adds percent Daily Value from the 2,000-calorie DRVs (fat 78 g, saturated fat 20 g, sodium 2,300 mg, carbohydrate 275 g, fiber 28 g, added sugars 50 g). Rules copied from the eCFR text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kcal | Yes | Calories per serving, unrounded. | |
| fat_g | No | Total fat, g per serving. | |
| carbs_g | No | Total carbohydrate, g per serving. | |
| fiber_g | No | Dietary fiber, g per serving. | |
| sugars_g | No | Total sugars, g per serving. | |
| protein_g | No | Protein, g per serving. | |
| sat_fat_g | No | Saturated fat, g per serving. | |
| sodium_mg | No | Sodium, mg per serving. | |
| added_sugars_g | No | Added sugars, g per serving. |