From 579b09841faa3a9dc4ebc2653cff5cbf4379b65d Mon Sep 17 00:00:00 2001 From: kennethcheng Date: Wed, 29 Apr 2026 01:01:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BD=BF=E7=94=A8=20Big.js=20?= =?UTF-8?q?=E5=89=A5=E7=A6=BB=E6=B5=81=E6=B0=B4=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E6=97=A0=E6=84=8F=E4=B9=89=E5=B0=BE=E9=9A=8F=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Memory.md | 4 ++++ app/dashboard/page.tsx | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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()} -