修复币本位报价误走USDC,中控补资金账户并隐藏零币余额

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 13:08:28 +08:00
parent 73efad6fa5
commit f3de3763bb
6 changed files with 226 additions and 18 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ def _fmt_coin_amount(v: float | None) -> str | None:
n = float(v)
except (TypeError, ValueError):
return None
if abs(n) < 1e-12:
if n <= 0:
return None
txt = f"{n:.6f}".rstrip("0").rstrip(".")
return txt or None
@@ -1158,7 +1158,7 @@ function formatTradingAccountLabel(usdt, eth, btc, marginMode) {
const pushCoin = (v, ccy) => {
if (v === null || v === undefined || v === "") return;
const n = Number(v);
if (Number.isNaN(n) || Math.abs(n) < 1e-12) return;
if (Number.isNaN(n) || !(n > 0)) return;
const txt = String(n.toFixed(6)).replace(/\.?0+$/, "");
parts.push(`${txt || "0"} ${ccy}`);
};
+1 -1
View File
@@ -1639,7 +1639,7 @@ function formatTradingAccountLabel(usdt, eth, btc, marginMode) {
const pushCoin = (v, ccy) => {
if (v == null || v === "") return;
const n = Number(v);
if (Number.isNaN(n) || Math.abs(n) < 1e-12) return;
if (Number.isNaN(n) || !(n > 0)) return;
const txt = String(n.toFixed(6)).replace(/\.?0+$/, "");
parts.push(`${txt || "0"} ${ccy}`);
};