fix(ui): 修复 Big.js 误用 .ne() 方法导致的 TypeError,改用 !.eq() 实现判零逻辑
This commit is contained in:
parent
2bce92dc0c
commit
a04c573cd3
@ -71,8 +71,8 @@ export default async function DashboardPage() {
|
||||
const posPnlNative = new Big(pos.pnlNative);
|
||||
const posPnlNativePositive = posPnlNative.gte(0);
|
||||
|
||||
const avgCostFormatted = new Big(pos.avgCost).ne(0) && pos.avgCost !== '0' ? formatAmount(pos.avgCost) : '-';
|
||||
const dilutedCostFormatted = new Big(pos.dilutedCost).ne(0) && pos.dilutedCost !== '0' ? formatAmount(pos.dilutedCost) : '-';
|
||||
const avgCostFormatted = !new Big(pos.avgCost).eq(0) && pos.avgCost !== '0' ? formatAmount(pos.avgCost) : '-';
|
||||
const dilutedCostFormatted = !new Big(pos.dilutedCost).eq(0) && pos.dilutedCost !== '0' ? formatAmount(pos.dilutedCost) : '-';
|
||||
|
||||
return (
|
||||
<Card key={pos.assetId}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user