取整 加入 向下取整和 四首五入取整

This commit is contained in:
java110 2021-03-26 17:12:15 +08:00
parent 9d43d6a33d
commit 2b5d41fd67

View File

@ -269,7 +269,11 @@
return $that._mathToFixed1(num);
} else if ($that.payFeeOrderInfo.toFixedSign == 3) {
return $that._mathCeil(num);
} else {
}else if ($that.payFeeOrderInfo.toFixedSign == 4) {
return $that._mathFloor(num);
}else if ($that.payFeeOrderInfo.toFixedSign == 5) {
return $that._mathRound(num);
} else {
return $that._mathToFixed2(num);
}
},
@ -301,6 +305,12 @@
_mathFloor: function (_price) {
return Math.floor(_price);
},
/**
* 四首五入取整
*/
_mathRound: function (_price) {
return Math.round(_price);
},
/**
* 保留小数点后一位
*/