Browse Source

fix: 报告百分比展示问题

zhangjie 4 months ago
parent
commit
a3c50ea393
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/plugins/filters.js

+ 2 - 2
src/plugins/filters.js

@@ -29,7 +29,7 @@ import {
   EVALUATION_MODE,
   COURSE_TYPE,
 } from "../constants/enumerate";
-import { formatDate } from "../plugins/utils";
+import { formatDate, toPrecision } from "../plugins/utils";
 
 const DEFAULT_FIELD = "--";
 
@@ -141,5 +141,5 @@ Vue.filter("courseTypeFilter", function (val) {
   return COURSE_TYPE[val] || DEFAULT_FIELD;
 });
 Vue.filter("progressFilter", function (val) {
-  return !val && val !== 0 ? "0" : val * 100;
+  return !val && val !== 0 ? "0" : toPrecision(val * 100, 2);
 });