From 1688fa96337cc5289d4315d316e13d9531263611 Mon Sep 17 00:00:00 2001 From: WrBug Date: Thu, 26 Feb 2026 21:30:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E4=BC=98=E5=8C=96"=E6=9C=80?= =?UTF-8?q?=E5=A4=A7"=E6=8C=89=E9=92=AE=E8=AE=A1=E7=AE=97=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BF=9D=E7=95=992=E4=BD=8D=E5=B0=8F?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改前:只能整数数量,导致余额浪费 - 示例:余额2.95U,价格0.86 → 数量3张(浪费0.37U) - 修改后:保留2位小数,充分利用余额 - 示例:余额2.95U,价格0.86 → 数量3.43张(利用全部余额) Made-with: Cursor --- frontend/src/pages/CryptoTailMonitor.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/CryptoTailMonitor.tsx b/frontend/src/pages/CryptoTailMonitor.tsx index bd9014f..091310f 100644 --- a/frontend/src/pages/CryptoTailMonitor.tsx +++ b/frontend/src/pages/CryptoTailMonitor.tsx @@ -886,9 +886,10 @@ const CryptoTailMonitor: React.FC = () => { return } - // 最大数量 = Math.floor(可用余额 / 价格) - const maxSize = Math.floor(balance / price) + // 最大数量 = 余额 / 价格,保留2位小数 + let maxSize = Math.floor((balance / price) * 100) / 100 + // 确保至少 1 张 if (maxSize < 1) { message.warning(t('cryptoTailMonitor.manualOrder.insufficientBalanceForMax')) return