money-module/src/main/kotlin/com/cubetiqs/libra/moneyutils/Money.kt
2020-08-26 21:32:06 +07:00

24 lines
551 B
Kotlin

package com.cubetiqs.libra.moneyutils
open class Money(
var value: Double,
var currency: String = "USD"
) : StdMoney {
//////////////////// - PROPERTIES - ////////////////////
override fun getMoneyValue(): Double {
return this.value
}
override fun getMoneyCurrency(): String {
return this.currency.toUpperCase()
}
//////////////////// - GENERIC - ////////////////////
override fun toString(): String {
return "Money(value=${getMoneyValue()}, currency='${getMoneyCurrency()}')"
}
}