You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tables): refuse scale suffixes and resolve the lone-separator ambiguity
A verification pass over the previous commit found that my own fix opened a new
hole of the class it closed.
Widening the currency marker to 1-3 letters made scale suffixes parse: `1.2 M`
read as 1.2, so a column of `1.2 M` / `3.4 M` — an ordinary spreadsheet paste —
converted cleanly and rewrote every cell a millionfold too small. Before the
widening those were rejected and the data was safe. Now refused explicitly,
while `kr` and `zł` still parse despite starting with the same letters.
Stripping the marker also newly routed formatted zero-decimal amounts into the
lone-separator branch, where a single dot was always decimal: `1.235 ¥` read as
1.235 rather than 1235. That is a wrong number where there used to be a
refusal, which is the worse failure. A lone separator followed by three digits
is now resolved by two signals — a marker means a formatter produced it, and
formatters group; a currency carrying three decimals (KWD, TND) reads them as
decimals. `coerce` passes the column's code, so the parser can ask. Bare typed
input keeps the decimal reading.
Also: the unchanged-type throw fell through to a 500 for every type except
currency, whose message happened to contain the word; it now maps to 400. And
the last three comments describing the removed two-transaction architecture are
gone — the previous commit claimed they were and two survived.
Documented, and failing closed rather than guessing: markers written flush
against the digits (`Rp12,00`) stay rejected, because a letter touching a digit
is the only thing distinguishing a currency marker from a part number, and
reading `SKU400` as 400 invents a value where refusing merely inconveniences.
0 commit comments