TP-40576 add prefix text support in money format input transformation (#181)

This commit is contained in:
Hitesh Kumar
2023-09-19 11:48:59 +05:30
committed by GitHub
parent a9598a8194
commit cd5d5e6a0c
2 changed files with 7 additions and 2 deletions

View File

@@ -78,7 +78,8 @@ data class OutlinedTextFieldValueTransformation(
val type: String? = null,
val formatPattern: String? = null,
val currentDateFormat: String? = null,
val targetDateFormat: String? = null
val targetDateFormat: String? = null,
val prefixText: String? = null
)
data class TextFieldIconData(val leadingIcon: UiTronView, val trailingIcon: UiTronView)

View File

@@ -338,7 +338,11 @@ fun getTransformedText(
inputText,
valueTransformation.formatPattern
)
InputTransformationType.MONEY_WITH_RUPEE_SYMBOL.name -> moneyFormat(inputText).let { "$it" }
InputTransformationType.MONEY_WITH_RUPEE_SYMBOL.name -> moneyFormat(inputText).let { text ->
valueTransformation.prefixText?.let { prefix ->
"$prefix$text"
} ?: "$text"
}
else -> null
}
} ?: return null