Updated on 2026-08-14

This commit is contained in:
Tangem 2023-02-07 14:59:17 +03:00
parent 91c52c039c
commit ae758bc308
8 changed files with 87 additions and 51 deletions

View file

@ -10,7 +10,7 @@ package com.tangem.core.ui.utils
*/
fun getValidatedNumberWithFixedDecimals(text: String, decimals: Int): String {
val comma = ','
val dot = ','
val dot = '.'
val filteredChars = text.replace(comma, dot).filterIndexed { index, c ->
val isOneOrZeroPoint = c == dot && index != 0 && text.count { it == dot } <= 1
val isIndexPointIndex = c == dot && index != 0 && text.indexOf(dot) == index