Explorar el Código

bug-5482 计算精度丢失

tianxinyu hace 9 meses
padre
commit
f2f14aee09
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/views/component/deviceValidation/index.vue

+ 1 - 1
src/views/component/deviceValidation/index.vue

@@ -363,7 +363,7 @@ export default {
                 // 计算差值/偏倚
                 if (!isNaN(houJieGuo) && !isNaN(qianJieGuo)) {
                     if (jiSuanGongShi === '|Y-X|') {
-                        item.shiJiChaZhi = Math.abs((houJieGuo * 100000 - qianJieGuo * 100000) / 100000)
+                        item.shiJiChaZhi = Math.abs((houJieGuo * 100000 - qianJieGuo * 100000) / 100000).toFixed(2)
                         item.shiFouXiangFu = normalizePercent(item.shiJiChaZhi) <= normalizePercent(xianDingFanWei) ? '相符' : '不相符'
                         item.shiJiPianYi = ''
                     } else {