Fix ATAS locale-formatted number parsing#164
Conversation
Co-authored-by: Hugo Demenez <hugodemenez@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Automated Code ReviewFindings
Open Questions / Assumptions
Review SummaryThe PR improves locale-aware number parsing and adds helpful tests, but introduces a critical import regression: numeric cell values can now be treated as invalid and skipped. Fixing Generated by Cursor CLI workflow |
Summary
1 234,56 €are saved as1234.56instead of being truncated.Bug and Impact
French/European ATAS workbook exports can produce strings such as
1 234,56 €. The ATAS importer stripped commas beforeparseFloat, turning that value into1and saving incorrect PnL. The same parsing style affected price and volume fields, which could corrupt saved trade prices/quantities and side detection.Root Cause
The recent XLSX parsing path emits formatted strings (
raw: false), butatas-processor.tsxstill used US-centric comma stripping andparseFloat.Validation
node --loader ts-node/esm --experimental-specifier-resolution=node --test lib/ninjatrader-number-parser.test.tsnpm run typecheck