2021-02-08 11:24:14 +07:00
|
|
|
package com.cubetiqs.money
|
2020-08-26 20:06:06 +07:00
|
|
|
|
2020-08-27 10:48:31 +07:00
|
|
|
operator fun StdMoney.unaryMinus() = (-getMoneyValue())
|
|
|
|
operator fun StdMoney.unaryPlus() = (+getMoneyValue())
|
2020-08-26 20:06:06 +07:00
|
|
|
operator fun Money.inc() = Money(value++)
|
|
|
|
operator fun Money.dec() = Money(value--)
|
2020-08-27 10:48:31 +07:00
|
|
|
operator fun StdMoney.plus(other: StdMoney) = Money(getMoneyValue() + other.getMoneyValue())
|
|
|
|
operator fun StdMoney.times(other: StdMoney) = Money(getMoneyValue() * other.getMoneyValue())
|
|
|
|
operator fun StdMoney.div(other: StdMoney) = Money(getMoneyValue() / other.getMoneyValue())
|
|
|
|
operator fun Money.timesAssign(other: StdMoney) {
|
|
|
|
this.value = this.getMoneyValue() * other.getMoneyValue()
|
|
|
|
}
|