fix(ui): 使用 Big.js 剥离流水数据的无意义尾随零
This commit is contained in:
parent
fd529404bc
commit
579b09841f
@ -74,6 +74,10 @@
|
||||
- 在 `app/dashboard/page.tsx` 中新增 `txTypeMap` 字典,將 `BUY`/`SELL`/`DIVIDEND`/`AIRDROP` 映射為對應中文(買入/賣出/分紅/空投)。
|
||||
- 流水明細子表格中渲染 `tx.txType` 的邏輯替換為 `{txTypeMap[tx.txType] || tx.txType}`,保留原始值兜底。
|
||||
|
||||
## 利用 Big.js 剥离流水明细无意义尾随零 (Task 42b)
|
||||
- 利用 `Big.js` 剥离了流水明细中无意义的尾随零,提升了高精度数据的可读性。
|
||||
- 在 `app/dashboard/page.tsx` 的流水明細子表格中,将 `tx.quantity`、`tx.price`、`tx.fee` 的渲染逻辑改为 `new Big(value).toString()`,安全剥离因数据库 `numeric(36,18)` 配置导致的如 `0.041000000000000000` 这类冗余尾随零。
|
||||
|
||||
## 持倉引擎 Native 幣種算法重構 (Task 38)
|
||||
- 重構底層盈虧引擎,全面轉向 Native 原生幣種計算,新增浮動/累計盈虧及百分比指標。
|
||||
- 徹底分離 Native 與 CNY 計算:單隻股票的成本與盈虧全部改用 Native (原幣種) 進行計算。
|
||||
|
||||
@ -315,11 +315,11 @@ export default function DashboardPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-right text-xs">
|
||||
<div className="flex flex-col items-end">
|
||||
<span>量: {tx.quantity}</span>
|
||||
<span>價: {tx.price}</span>
|
||||
<span>量: {new Big(tx.quantity).toString()}</span>
|
||||
<span>價: {new Big(tx.price).toString()}</span>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell className="text-right text-xs">{tx.fee || '0'}</TableCell>
|
||||
<TableCell className="text-right text-xs">{new Big(tx.fee || 0).toString()}</TableCell>
|
||||
<TableCell className="text-xs text-muted-foreground">-</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user