Updated on 2026-08-14
This commit is contained in:
parent
cd99a8323f
commit
e4e6499d4d
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ package com.tangem.core.ui.utils
|
|||
* result string 123.46377372
|
||||
*/
|
||||
fun getValidatedNumberWithFixedDecimals(text: String, decimals: Int): String {
|
||||
val filteredChars = text.filterIndexed { index, c ->
|
||||
val filteredChars = text.replace(",", ".").filterIndexed { index, c ->
|
||||
val isOneOrZeroPoint = c == '.' && index != 0 && text.count { it == '.' } <= 1
|
||||
val isIndexPointIndex = c == '.' && index != 0 && text.indexOf('.') == index
|
||||
c.isDigit() || isIndexPointIndex || isOneOrZeroPoint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue