Add adavanced money formatter and decimal functions for money format and add function builder and money extension updated and add money view for money module

Add money formatter provider for general provider formatter
This commit is contained in:
2021-02-09 12:05:02 +07:00
parent 7497e11ee3
commit 003e1a59db
8 changed files with 293 additions and 20 deletions

View File

@@ -0,0 +1,26 @@
package com.cubetiqs.money
open class MoneyView(
private var value: Number? = null,
private var currency: String? = null,
) : MoneyMixin {
constructor(money: StdMoney) : this() {
this.value = money.getValue()
this.currency = money.getCurrency().getCurrency()
}
fun getValue(): Double {
return value?.toDouble() ?: 0.0
}
fun getCurrency(): String? {
return currency
}
fun getFormat(): String {
return MoneyConfig
.getFormatter(getCurrency())
.setValue(this.asStdMoney())
.format()
}
}