diff --git a/app/src/main/java/com/concordium/wallet/uicore/DecimalTextWatcher.kt b/app/src/main/java/com/concordium/wallet/uicore/DecimalTextWatcher.kt index 71428805..149292d3 100644 --- a/app/src/main/java/com/concordium/wallet/uicore/DecimalTextWatcher.kt +++ b/app/src/main/java/com/concordium/wallet/uicore/DecimalTextWatcher.kt @@ -25,6 +25,12 @@ class DecimalTextWatcher(val maxNumberOfDecimals: Int = 1) : TextWatcher { override fun afterTextChanged(editable: Editable) { var str = editable.toString() + + // Remove thousands comma delimiter if inserted value is not an integer + if (str.contains(",") && str.contains(".")) { + str = str.replace(",", "") + } + // Replace the non decimal separator with the decimal separator if ("." != "" + separator) { if (str.indexOf(",") > -1) {