This commit is contained in:
laodaming
2023-06-13 17:47:48 +08:00
parent da347feac9
commit d941402ef1
13 changed files with 502 additions and 18 deletions

16
utils/step_price/price.go Normal file
View File

@@ -0,0 +1,16 @@
package step_price
func GetStepPrice(minBuyNum int, stepNum []int, stepPrice []int) float64 {
if minBuyNum > stepNum[len(stepNum)-1] {
return float64(stepPrice[len(stepPrice)-1]) / float64(100)
}
for k, v := range stepNum {
if minBuyNum <= v {
if k <= (len(stepPrice) - 1) {
return float64(stepPrice[k]) / float64(100)
}
return float64(stepPrice[len(stepPrice)-1]) / float64(100)
}
}
return float64(stepPrice[len(stepPrice)-1]) / float64(100)
}