diff options
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt b/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt index 3d1d284..a524d1b 100644 --- a/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt +++ b/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt @@ -148,7 +148,12 @@ private class AmountInputVisualTransformation( } } - val formattedNumber = intPart + decimalSeparator + fractionPart + // Hide trailing decimal separator if decimals are 0 + val formattedNumber = if (numberOfDecimals > 0) { + intPart + decimalSeparator + fractionPart + } else { + intPart + } val newText = AnnotatedString( text = formattedNumber, |