Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix wrong balance int part
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 2, 2022
1 parent ff6e8ba commit 77b27e2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.ivy.wallet.utils.decimalPartFormatted
import com.ivy.wallet.utils.shortenAmount
import com.ivy.wallet.utils.shouldShortAmount
import java.text.DecimalFormat
import kotlin.math.truncate

@Composable
fun BalanceRowMedium(
Expand Down Expand Up @@ -121,10 +120,12 @@ fun BalanceRow(
Spacer(Modifier.width(spacerCurrency))
}

val balancePrecise = balance.toBigDecimal()

val integerPartFormatted = if (shortAmount) {
shortenAmount(balance)
} else {
DecimalFormat("###,###").format(truncate(balance))
DecimalFormat("###,###").format(balancePrecise.toInt())
}
Text(
text = when {
Expand Down

0 comments on commit 77b27e2

Please sign in to comment.