新增木浆棉
This commit is contained in:
@@ -3673,6 +3673,9 @@ public class PriceUtils {
|
||||
|
||||
public double calcByTargetN(int startN, double highPrice, int endN, double lowPrice, int targetN) {
|
||||
// 高价商品个数线性插值
|
||||
if (endN == startN) {
|
||||
return highPrice * targetN;
|
||||
}
|
||||
double a = startN * (double) (endN - targetN) / (endN - startN);
|
||||
double b = targetN - a;
|
||||
double total = a * highPrice + b * lowPrice;
|
||||
|
||||
Reference in New Issue
Block a user