Browse Source

首页conter数据处理。

yangc 8 years ago
parent
commit
6d2a5a7f93
1 changed files with 4 additions and 1 deletions
  1. 4 1
      components/main/count/Item.vue

+ 4 - 1
components/main/count/Item.vue

@@ -28,10 +28,13 @@
     },
     methods: {
       formatNumber (num) {
+        console.log(num)
         let re = /(\d+)(\d{3})/
         if (num > 9999) {
           this.isMore = true
-          console.log(num.toString().charAt(4))
+          let str = num.toString()
+          console.log(str.charAt(str.length - 5))
+          console.log(num / 10000)
         }
         num = (Array(10 - String(num).length).join(0) + num)
         while (re.test(num)) {