[Good first issue] 标出持仓导入中千分位格式有歧义的数字

Open Beginner friendly
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript
Domain
data, tooling

Research direction

Start with the numeric conversion in packages/shared/src/portfolio-import/parsers.ts around lines 86-108, which currently strips every comma, then check the row-level quantity and cost hint logic around lines 268-308. Add a parser test in parsers.test.ts for 12,34, 1,234.50 and 1234.50, and run bun test packages/shared/src/portfolio-import/parsers.test.ts. Done means 12,34 yields a review hint on the cost field while the two valid formats keep their current values.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted

最小复现

用下面的合成数据调用 parseCsv。解析结果把成本 12,34 记为 1234,confidence 为 1,issues 为空。当前数值转换会直接删除所有逗号。

Symbol,Quantity,Cost,Currency
AAPL.US,10,"12,34",USD

验证环境为 Windows、Bun 1.4.2,基于 main 的 579395e。

验收标准

  • 逗号分组不符合千分位格式时,在数量或成本对应的字段上生成可审阅的格式提示,保留原值供用户核对。
  • 用离线数据覆盖 12,34、有效的 1,234.50 和普通小数 1234.50。有效格式的解析结果保持一致。

源码起点

验证入口 bun test packages/shared/src/portfolio-import/parsers.test.ts。

可以先在本条说明准备完成的范围,再评论 /claim。贡献入口见 #7。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
8h 8m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.