You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
337 B

package factory
import "math"
// CashReturn
// @Description: 返利收费
type CashReturn struct {
MoneyCondition float64
MoneyReturn float64
}
func (c *CashReturn) AcceptCash(money float64) float64 {
ret := money
if money >= c.MoneyCondition {
ret = money - math.Floor(money/c.MoneyCondition)*c.MoneyReturn
}
return ret
}