FA-84633 / Betting odds conversion / Member archive
Decimal price compared with fractions without removing the stake · case 03
A 3.00 price is displayed as 3/1 instead of 2/1.
Case contract
Display a decimal price (> 1, else "invalid") as the nearest traditional fraction from the ascending ladder ['1/10', '1/8', '1/5', '2/9', '1/4', '2/7', '1/3', '4/11', '2/5', '4/9', '1/2', '8/15', '4/7', '8/13', '4/6', '8/11', '4/5', '5/6', '10/11', 'evens', '11/10', '6/5', '5/4', '11/8', '6/4', '13/8', '7/4', '15/8', '2/1', '9/4', '5/2', '11/4', '3/1', '10/3', '7/2', '4/1', '9/2', '5/1', '11/2', '6/1', '13/2', '7/1', '15/2', '8/1', '17/2', '9/1', '10/1', '11/1', '12/1', '14/1', '16/1', '18/1', '20/1', '25/1', '33/1', '40/1', '50/1', '66/1', '100/1']. Distance is |fraction value - (d - 1)| with "evens" = 1; ties go to the earlier (shorter) ladder entry. Return the ladder string.
Why this case matters
UK-facing sites display decimal model prices as familiar traditional fractions.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control exact fraction | "7/2" | "5/2" | 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 ↗