Updated on 2026-08-14
This commit is contained in:
parent
91c52c039c
commit
ae758bc308
8 changed files with 87 additions and 51 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue