FA-96892 / Recipe scaling and nutrition / Member archive
Nutrition label rounding: cholesterol less-than band · case 02
3 mg cholesterol prints "5 mg" instead of "less than 5 mg".
Case contract
Round a panel dict to displayed strings (toy label rules, half-up): calories <5 -> 0, <=50 -> nearest 5, else nearest 10; fat g <0.5 -> 0, <5 -> nearest 0.5, else nearest 1; sodium mg <5 -> 0, <=140 -> nearest 5, else nearest 10; cholesterol mg <2 -> "0 mg", <5 -> "less than 5 mg", else nearest 5; carbs g <0.5 -> "0 g", <1 -> "less than 1 g", else nearest 1. Absent keys are omitted. Values print with %g formatting.
Why this case matters
Packaged food and meal-kit labels are generated from recipe nutrition totals with banded rounding rules that differ per nutrient.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: cholesterol less-than band | {"calories": "10", "cholesterol": "0 mg", "fat": "3 g", "sodium": "120 mg"} | {"calories": "10", "cholesterol": "less than 5 mg", "fat": "3 g", "sodium": "120 mg"} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗