Updated on 2026-08-14
This commit is contained in:
parent
77103de5d7
commit
b2196196e7
1 changed files with 1 additions and 1 deletions
|
|
@ -161,7 +161,7 @@ private fun String.preserveDecimalSymbol(newValue: String, decimalSymbol: Char)
|
|||
private fun String.preserveTrailingZeros(newValue: String, parsedDecimal: BigDecimal?, decimalSymbol: Char): String {
|
||||
val trailingZeros = newValue.split(decimalSymbol).getOrNull(1)?.takeLastWhile { it == '0' }.orEmpty()
|
||||
return when {
|
||||
this.endsWith('0') -> this
|
||||
this.endsWith('0') && parsedDecimal?.scale() != 0 -> this
|
||||
parsedDecimal?.scale() == 0 && trailingZeros.isNotEmpty() -> "$this$decimalSymbol$trailingZeros"
|
||||
else -> this.plus(trailingZeros)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue