修复币本位报价误走USDC,中控补资金账户并隐藏零币余额
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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}`);
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user