lrf402788946 há 4 anos atrás
pai
commit
cbfd35defd
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      parts/statistics/quest-chart.vue

+ 2 - 2
parts/statistics/quest-chart.vue

@@ -100,8 +100,8 @@ export default {
     getPercent(num) {
       let all = this.data.option.reduce((prev, next) => prev + next.value * 1 || 0, 0);
       if (all == 0) return 0;
-      let percent = (num * 1) / all;
-      percent = _.round(percent, 4) * 100;
+      let percent = _.round(_.divide(num * 1, all), 4);
+      percent = _.round(_.round(percent, 4) * 100, 2);
       return percent;
     },
     getPS(percent) {