Commit 66d5479
committed
fix(tables): group a lone dot only when a zero-decimal amount came formatted
Greptile found that a bare `1.235` typed into a JPY column stored 1235. The
zero-decimal branch read the dot as grouping without asking where the value
came from, so typing, pasting, a tool write, or an import all inflated a
thousandfold in silence.
The rule was inverted relative to its own evidence. Grouping was justified as
"the one lone-separator form a formatter emits" — and a formatter always emits
its marker too. The marker is exactly what separates formatter output from
someone typing, and I had removed it as redundant two commits ago.
So a lone dot groups only for a zero-decimal currency AND only when a marker
came with it. `1.235 ¥` and `JPY 1.235` still read as 1235; a bare `1.235`
now stores 1.235 and displays `¥1` — wrong in a way the writer can see and
correct, rather than a silent thousandfold error.
This does not walk back the earlier fix. For a currency with one or two
decimal places a formatter always emits BOTH separators, so a lone dot there
never came from one and stays a decimal whether or not a marker is present —
`$1.234` is still 1.234. The marker only carries information in the
zero-decimal case, which is the only case that now consults it.
The two overlapping lone-separator tests are replaced by three that each state
one rule. Verified the new one fails when the marker requirement is reverted.1 parent d4148d1 commit 66d5479
2 files changed
Lines changed: 57 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
171 | 168 | | |
172 | | - | |
| 169 | + | |
173 | 170 | | |
174 | 171 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
188 | 175 | | |
189 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
190 | 188 | | |
| 189 | + | |
191 | 190 | | |
| 191 | + | |
192 | 192 | | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
| |||
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
324 | | - | |
| 331 | + | |
| 332 | + | |
325 | 333 | | |
326 | 334 | | |
327 | 335 | | |
| |||
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
333 | | - | |
| 341 | + | |
| 342 | + | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
| |||
355 | 364 | | |
356 | 365 | | |
357 | 366 | | |
358 | | - | |
359 | | - | |
360 | | - | |
| 367 | + | |
361 | 368 | | |
362 | | - | |
363 | | - | |
364 | | - | |
| 369 | + | |
| 370 | + | |
365 | 371 | | |
366 | | - | |
367 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
368 | 382 | | |
369 | 383 | | |
370 | 384 | | |
371 | 385 | | |
372 | | - | |
| 386 | + | |
| 387 | + | |
373 | 388 | | |
374 | 389 | | |
375 | 390 | | |
376 | | - | |
| 391 | + | |
377 | 392 | | |
378 | 393 | | |
379 | 394 | | |
| |||
0 commit comments