FA-95907 / Postal address normalization / Member archive
Five-or-nine digit postal code: placeholder plus-four is kept · case 02
"12029-0000" is returned with its placeholder extension instead of "12029".
Case contract
Input a string or an integer. Integers are zero-padded to 5 digits when <= 99999, else to 9. Strings are stripped; a 10-character string with "-" or a space at index 5 loses that separator. Valid results are exactly 5 or 9 ASCII digits; 9 digits render "DDDDD-DDDD" unless the last four are "0000", which renders the 5-digit form. Anything else returns None.
Why this case matters
Postal codes arrive from spreadsheets, forms and legacy files; losing leading zeros or accepting malformed codes misroutes mail and breaks deduplication.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero plus-four is dropped | "23049-0000" | "23049" | 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 ↗