mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-17 05:51:02 +00:00
Fix: normalize live trade PnL cents/dollars
This commit is contained in:
@@ -296,7 +296,12 @@ function MarketCard({ market }) {
|
||||
function LiveOrderRow({ order, isOpen }) {
|
||||
const won = order.result && order.side?.toLowerCase() === order.result?.toLowerCase();
|
||||
const isNeutral = order.result === 'cancelled' || order.result === 'expired';
|
||||
const pnlVal = order.pnl != null ? (typeof order.pnl === 'number' && Math.abs(order.pnl) > 50 ? order.pnl / 100 : order.pnl) : null;
|
||||
|
||||
const rawPnl = order?.pnl != null ? Number(order.pnl) : null;
|
||||
const pnlVal = Number.isFinite(rawPnl)
|
||||
? (Number.isInteger(rawPnl) ? rawPnl / 100 : rawPnl)
|
||||
: null;
|
||||
|
||||
const pnlColor = pnlVal == null ? 'text-gray-600' : pnlVal > 0 ? 'text-green-400' : pnlVal < 0 ? 'text-red-400' : 'text-gray-400';
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user