We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5978520 commit 4bcd308Copy full SHA for 4bcd308
1 file changed
apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/CurrencyAppreciationLabel.kt
@@ -21,7 +21,8 @@ fun CurrencyAppreciationLabel(
21
appreciation: Fiat,
22
modifier: Modifier = Modifier,
23
) {
24
- val hasAppreciation = appreciation.decimalValue >= 0
+ val isZero = !appreciation.valueNonZero()
25
+ val hasAppreciation = appreciation.toDouble() >= 0
26
val changeColor = if (hasAppreciation) {
27
CodeTheme.colors.successText
28
} else {
@@ -44,7 +45,11 @@ fun CurrencyAppreciationLabel(
44
45
horizontal = CodeTheme.dimens.grid.x1
46
),
47
text = appreciation.formatted(
- extraPrefix = if (hasAppreciation) "+" else "-",
48
+ extraPrefix = when {
49
+ isZero -> null
50
+ hasAppreciation -> "+"
51
+ else -> "-"
52
+ },
53
54
style = CodeTheme.typography.textSmall,
55
color = changeColor,
0 commit comments