From 8dcd6f2f7292d5aaafd66345c074c4ef820438b5 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 19:47:31 +0800 Subject: [PATCH] style: fix margin calculation --- pkg/style/pnl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/style/pnl.go b/pkg/style/pnl.go index b56cb3316..48d6914ff 100644 --- a/pkg/style/pnl.go +++ b/pkg/style/pnl.go @@ -51,7 +51,7 @@ func PnLEmojiMargin(pnl, margin, resolution fixedpoint.Value) string { } if pnl.Sign() < 0 { - level := min((margin.Neg()).Div(resolution).Int(), MaxEmojiRepeat) + level := min(margin.Abs().Div(resolution).Int(), MaxEmojiRepeat) return strings.Repeat(LossEmoji, level) }