Add money mixin cast to and updated money extension and add money view for view in web deployer and try to updated and look around the casting
This commit is contained in:
@@ -94,8 +94,21 @@ fun String?.fromStringToMoney(): StdMoney {
|
||||
}
|
||||
}
|
||||
|
||||
fun StdMoney.isMatchedCurrency(currency: StdMoney.Currency) =
|
||||
this.getCurrency().getCurrency().equals(currency.getCurrency(), ignoreCase = true)
|
||||
// check the money currency
|
||||
fun StdMoney.isMatchedCurrency(currency: StdMoney.Currency) = this.getCurrency().isEquals(currency)
|
||||
|
||||
// transfer to any money mixin
|
||||
fun StdMoney.tryToCastToMixin(): MoneyMixin {
|
||||
return object : MoneyMixin {
|
||||
fun getValue(): Double {
|
||||
return this@tryToCastToMixin.getValue()
|
||||
}
|
||||
|
||||
fun getCurrency(): String {
|
||||
return this@tryToCastToMixin.getCurrency().getCurrency()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun buildMoneyConfigProperties(
|
||||
builderAction: MoneyConfig.MoneyConfigProperties.MoneyConfigPropertiesBuilder.() -> Unit
|
||||
|
||||
Reference in New Issue
Block a user