diff --git a/Memory.md b/Memory.md index 728680e..ac41987 100644 --- a/Memory.md +++ b/Memory.md @@ -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 (原幣種) 進行計算。 diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 4ab1f97..2f2f84b 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -315,11 +315,11 @@ export default function DashboardPage() {
- 量: {tx.quantity} - 價: {tx.price} + 量: {new Big(tx.quantity).toString()} + 價: {new Big(tx.price).toString()}
- {tx.fee || '0'} + {new Big(tx.fee || 0).toString()} -