FA-96855 / Recipe scaling and nutrition / Member archive
Servings scaler: count half-up rounding · case 05
4.5 eggs becomes 4 eggs and 2.75 limes becomes 2 limes.
Case contract
Scale [name, qty, unit, kind] rows from base to target servings. Factor f=target/base (both must be positive, else an error string). Seasoning rows scale by 1+(f-1)*3/4 (damped); other rows by f. Unit "each" rounds half-up to an integer with a floor of 1. Other units round half-up to the nearest 1/8 and print as reduced kitchen fractions ("1 1/2", "3/4", "2"); a zero result prints "pinch".
Why this case matters
Home and commercial recipe scalers must keep countable items whole and print measurable fractions cooks can actually portion.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| half egg rounds up | [["egg", "4", "each"], ["milk", "3/4", "cup"]] | [["egg", "5", "each"], ["milk", "3/4", "cup"]] | 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 ↗