feat(frontend): 优化"最大"按钮计算,支持保留2位小数

- 修改前:只能整数数量,导致余额浪费
  - 示例:余额2.95U,价格0.86 → 数量3张(浪费0.37U)
- 修改后:保留2位小数,充分利用余额
  - 示例:余额2.95U,价格0.86 → 数量3.43张(利用全部余额)

Made-with: Cursor
This commit is contained in:
WrBug
2026-02-26 21:30:18 +08:00
parent 1967d97c31
commit 1688fa9633
+3 -2
View File
@@ -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