Pārlūkot izejas kodu

格式化商品小数位

kevin_zhangl 3 gadi atpakaļ
vecāks
revīzija
91d8c16e6d
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      frontendEle/src/views/shop/index.vue

+ 3 - 3
frontendEle/src/views/shop/index.vue

@@ -194,9 +194,9 @@
                         item.forEach(accumulator => { accumulatorTax += tool.calculateTax(Number(accumulator.SELL_PRICE), Number(accumulator.TAX_RATE), Number(accumulator.chose_num)); });
                     })
 
-                    this.sell_price_sum = accumulatorSellPrice;
-                    this.price_pv_sum = accumulatorPricePv;
-                    this.tax_sum = accumulatorTax;
+                    this.sell_price_sum = parseFloat(accumulatorSellPrice).toFixed(2);
+                    this.price_pv_sum = parseFloat(accumulatorPricePv).toFixed(2);
+                    this.tax_sum = parseFloat(accumulatorTax).toFixed(2);
                 } else {
                     this.sell_price_sum = 0.00;
                     this.price_pv_sum = 0.00;