fix: Minus sign correction. (#18802)

This commit is contained in:
Siddhant 2024-11-27 12:22:58 +05:30 committed by GitHub
parent 9f1be47b37
commit 15f56c124a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,10 +117,9 @@ public class DataInsightDescriptionAndOwnerTemplate {
if (percent > 0) {
symbol = "+";
color = "#008611";
} else if (percent < 0) {
symbol = "-";
}
// No need for "-" since String.format handles negatives
return String.format(
"<span style=\"color:%s ; font-weight: 600\">%s%.2f%%</span>", color, symbol, percent);
}