فهرست منبع

Merge branch 'master' into release-20170915

yangc 8 سال پیش
والد
کامیت
5a8993c200

+ 4 - 3
components/product/ComponentGoods.vue

@@ -153,11 +153,12 @@
               num += '.00'
             } else {
               let inputStr = num.toString()
-              let floatNum = inputStr.split('.')[1]
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
               if (floatNum.length > 6) {
-                num = inputStr.substring(0, inputStr.length - 1)
+                num = inputStr.substring(0, arr[0].length + 7)
                 if (Number(floatNum.charAt(6)) > 4) {
-                  num = Number(num) + 0.000001
+                  num = (Number(num) * 1000000 + 1) / 1000000
                 }
               } else if (floatNum.length === 1) {
                 num = num + '0'

+ 4 - 3
components/product/component/StoreInfo.vue

@@ -166,11 +166,12 @@
               num += '.00'
             } else {
               let inputStr = num.toString()
-              let floatNum = inputStr.split('.')[1]
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
               if (floatNum.length > 6) {
-                num = inputStr.substring(0, inputStr.length - 1)
+                num = inputStr.substring(0, arr[0].length + 7)
                 if (Number(floatNum.charAt(6)) > 4) {
-                  num = Number(num) + 0.000001
+                  num = (Number(num) * 1000000 + 1) / 1000000
                 }
               } else if (floatNum.length === 1) {
                 num = num + '0'

+ 4 - 3
components/search/GoodList.vue

@@ -182,11 +182,12 @@
               input = input + '.00'
             } else {
               let inputStr = input.toString()
-              let floatNum = inputStr.split('.')[1]
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
               if (floatNum.length > 6) {
-                input = inputStr.substring(0, inputStr.length - 1)
+                input = inputStr.substring(0, arr[0].length + 7)
                 if (Number(floatNum.charAt(6)) > 4) {
-                  input = Number(input) + 0.000001
+                  input = (Number(input) * 1000000 + 1) / 1000000
                 }
               } else if (floatNum.length === 1) {
                 input = input + '0'

+ 4 - 3
components/store/CommodityInfo.vue

@@ -186,11 +186,12 @@ export default {
             num += '.00'
           } else {
             let inputStr = num.toString()
-            let floatNum = inputStr.split('.')[1]
+            let arr = inputStr.split('.')
+            let floatNum = arr[1]
             if (floatNum.length > 6) {
-              num = inputStr.substring(0, inputStr.length - 1)
+              num = inputStr.substring(0, arr[0].length + 7)
               if (Number(floatNum.charAt(6)) > 4) {
-                num = Number(num) + 0.000001
+                num = (Number(num) * 1000000 + 1) / 1000000
               }
             } else if (floatNum.length === 1) {
               num = num + '0'

+ 4 - 3
components/store/CommodityList.vue

@@ -174,11 +174,12 @@ export default {
             num += '.00'
           } else {
             let inputStr = num.toString()
-            let floatNum = inputStr.split('.')[1]
+            let arr = inputStr.split('.')
+            let floatNum = arr[1]
             if (floatNum.length > 6) {
-              num = inputStr.substring(0, inputStr.length - 1)
+              num = inputStr.substring(0, arr[0].length + 7)
               if (Number(floatNum.charAt(6)) > 4) {
-                num = Number(num) + 0.000001
+                num = (Number(num) * 1000000 + 1) / 1000000
               }
             } else if (floatNum.length === 1) {
               num = num + '0'