fix(ui): 修复现价变量映射错误,修正负收益绿色显示丢失负号的 Bug

This commit is contained in:
2026-04-29 01:40:25 +08:00
parent 1b947d563a
commit 7c2f464f2c
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ function formatPnl(value: string, percent: string, baseCurrency: string): { text
const symbol = getCurrencySymbol(baseCurrency);
const absValue = new Big(value).abs().toFixed(2);
const absPercent = new Big(percent).abs().toFixed(2);
const text = `${symbol}${absValue} (${absPercent}%)`;
const text = `${symbol}${isPositive ? '' : '-'}${absValue} (${isPositive ? '' : '-'}${absPercent}%)`;
const className = isPositive ? 'text-red-500' : 'text-green-500';
return { text, className };
}