Commit 3fa3b992 by 杨树贤

运费规则小数问题

parent 20d7ccda
......@@ -45,12 +45,16 @@
let orderAmount = $('#order_amount').val();
if (orderAmount) {
orderAmountFormat = currency == 1 ? '¥' + orderAmount : '$' + orderAmount;
orderAmount = parseFloat(orderAmount);
$('order_amount').val(orderAmount.toFixed(2));
orderAmountFormat = currency == 1 ? '¥' + orderAmount.toFixed(2) : '$' + orderAmount.toFixed(2);
}
let shippingCost = $('#shipping_cost').val();
if (shippingCost) {
shippingCost = parseInt(shippingCost);
shippingCost = parseFloat(shippingCost);
$('shipping_cost').val(shippingCost.toFixed(2));
shippingCostFormat = currency == 1 ? '¥' + shippingCost.toFixed(2) : '$' + shippingCost.toFixed(2);
console.log(shippingCostFormat);
}
if (orderAmount) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment