From d7fceb14f6fab12f62114ff36a2ec00bd6c7c1c2 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 30 七月 2024 14:46:54 +0800 Subject: [PATCH] 优化检验任务计算值最终值小数位数保留 --- static/js/worker.js | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/static/js/worker.js b/static/js/worker.js index 60c3ac5..28c9c74 100644 --- a/static/js/worker.js +++ b/static/js/worker.js @@ -339,6 +339,11 @@ try{ if(comResult==0){ a[b].v.v = 0 + }else if(a[b].v.ct&&a[b].v.ct.fa&&typeof a[b].v.ct.fa == 'string'&&a[b].v.ct.fa.includes('.')){ + let num = 0 + let str = n.v.ct.fa.split('.')[1] + num = str.length + a[b].v.v = comResult?Number(comResult).toFixed(num):0 }else{ let val = parseFloat(Number(comResult).toFixed(3)) a[b].v.v = isNaN(val) ? '' : val -- Gitblit v1.9.3