const blurGoodsDecimal = (val, i) => { let data = OrderDetailsParam.value.inquiryGoodsParams; data[i][val] = Number(data[i][val]); if (val == "length" || val == "wide" || val == "high") { oneVolume(data, i); getTotalVolume(data, i); } if (val == "singleBoxVolume" || val == "ctns" || val == "singleBoxWeight") { getTotalVolume(data, i); getTotalWeight(data, i); } getTotalRatio(data, i); getBillingTotal(data, i); };改成使用Big.js
时间: 2024-04-12 19:34:11 浏览: 61
vue中使用input[type="file"]实现文件上传功能
5星 · 资源好评率100%
const blurGoodsDecimal = (val, i) => {
let data = OrderDetailsParam.value.inquiryGoodsParams;
data[i][val] = new Big(data[i][val]);
if (val === "length" || val === "wide" || val === "high") {
oneVolume(data, i);
getTotalVolume(data, i);
}
if (
val === "singleBoxVolume" ||
val === "ctns" ||
val === "singleBoxWeight"
) {
getTotalVolume(data, i);
getTotalWeight(data, i);
}
getTotalRatio(data, i);
getBillingTotal(data, i);
};
以上代码已经使用了 Big.js 进行了修改,以确保精确计算。
阅读全文