style: fix margin calculation

This commit is contained in:
c9s 2024-11-15 19:47:31 +08:00
parent 452e761ce6
commit 8dcd6f2f72
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -51,7 +51,7 @@ func PnLEmojiMargin(pnl, margin, resolution fixedpoint.Value) string {
} }
if pnl.Sign() < 0 { 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) return strings.Repeat(LossEmoji, level)
} }