wyq 3 лет назад
Родитель
Сommit
90569e6b83
2 измененных файлов с 10 добавлено и 10 удалено
  1. 5 5
      src/js/informationOut.js
  2. 5 5
      src/js/staticInfo.js

+ 5 - 5
src/js/informationOut.js

@@ -478,12 +478,12 @@ function getResult(pushInfo, textType, constant) {
         }
       });
       num = num + constant
-      num = parseFloat(num).toFixed(2)
+      num = parseFloat(num)
       tmp = arr.join(";");
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')'
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')'
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
@@ -491,7 +491,7 @@ function getResult(pushInfo, textType, constant) {
             }
             break
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')' + ';' + tmp
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
@@ -513,7 +513,7 @@ function getResult(pushInfo, textType, constant) {
         });
         $(".result_title").html('结果:' + result);
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         $(".result").css('display', 'block')
         $(".score").css('display', 'block')
@@ -521,7 +521,7 @@ function getResult(pushInfo, textType, constant) {
         $(".foot").css('display', 'block')
       } else {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         $(".score").css('display', 'block')
         $(".copy").css('display', 'none')

+ 5 - 5
src/js/staticInfo.js

@@ -407,12 +407,12 @@ function getResult(pushInfo, textType, constant) {
         }
       });
       num = num + constant
-      num = parseFloat(num).toFixed(2)
+      num = parseFloat(num)
       tmp = arr.join(";");
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')'
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')'
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
@@ -420,7 +420,7 @@ function getResult(pushInfo, textType, constant) {
             }
             break
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')' + ';' + tmp
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
@@ -442,7 +442,7 @@ function getResult(pushInfo, textType, constant) {
         });
         $(".result_title").html('结果:' + result);
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         $(".result").css('display', 'block')
         $(".score").css('display', 'block')
@@ -450,7 +450,7 @@ function getResult(pushInfo, textType, constant) {
         $(".foot").css('display', 'block')
       } else {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         $(".score").css('display', 'block')
         $(".copy").css('display', 'none')