Skip to content

fix(portfolio-import): 会计括号、尾随减号与全角数字解析 - #359

Closed
wannT-1 wants to merge 2 commits into
helsome:mainfrom
wannT-1:cursor/portfolio-import-accounting-digits-22ff
Closed

wannT-1 wants to merge 2 commits into
helsome:mainfrom
wannT-1:cursor/portfolio-import-accounting-digits-22ff

Conversation

@wannT-1

@wannT-1 wannT-1 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

改动说明

What: 会计括号与尾随减号按负数解析;全角数字与分隔符按半角数值解析。

Why: 导出表常见 (1,234) / 1234- / 全角数字,原先无法正确转成有限数值。

关联 Issue

Related to portfolio import robustness (Aug slice). Does not close an issue.

测试

  • Bun 1.4.3;portfolio-import 相关:110 pass;shared typecheck exit 0。

对账单里的 (180.50)、($1,234.50) 和 1,234.56- 不再被当成无效成本。全角括号同样按负数解析。只有括号或货币符号、没有数字时仍然无效。
中文表格里的全角数字、全角逗号、全角小数点和全角美元符号不再让数量或成本变成缺失字段。
@wannT-1

wannT-1 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #356.

Overlap measurement across the four open portfolio-import PRs: 28 of this branch's 31 added source lines are already contained in #356, which handles the same constructs (accounting parentheses, trailing minus, fullwidth digits) inside one normalisation pipeline. #356 is now updated against main (#413 trailing-% and #414 semicolon CSV merged) and its portfolio-import suite is 125 pass / 0 fail, so keeping one PR avoids asking the maintainer to reconcile four conflicting branches over the same three functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant