Skip to content

Commit 4bcd308

Browse files
committed
style(core): show 0.00 appreciation as green and remove qualifier prefix
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 5978520 commit 4bcd308

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/CurrencyAppreciationLabel.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ fun CurrencyAppreciationLabel(
2121
appreciation: Fiat,
2222
modifier: Modifier = Modifier,
2323
) {
24-
val hasAppreciation = appreciation.decimalValue >= 0
24+
val isZero = !appreciation.valueNonZero()
25+
val hasAppreciation = appreciation.toDouble() >= 0
2526
val changeColor = if (hasAppreciation) {
2627
CodeTheme.colors.successText
2728
} else {
@@ -44,7 +45,11 @@ fun CurrencyAppreciationLabel(
4445
horizontal = CodeTheme.dimens.grid.x1
4546
),
4647
text = appreciation.formatted(
47-
extraPrefix = if (hasAppreciation) "+" else "-",
48+
extraPrefix = when {
49+
isZero -> null
50+
hasAppreciation -> "+"
51+
else -> "-"
52+
},
4853
),
4954
style = CodeTheme.typography.textSmall,
5055
color = changeColor,

0 commit comments

Comments
 (0)