From ee528b89f22d1054ef7c4391c6fc54f2bd39612b Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 30 七月 2024 20:00:48 +0800 Subject: [PATCH] 修改客户培训提出的优化 --- static/js/worker.js | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/static/js/worker.js b/static/js/worker.js index beba853..28c9c74 100644 --- a/static/js/worker.js +++ b/static/js/worker.js @@ -339,8 +339,13 @@ 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(comResult.toFixed(3)) + let val = parseFloat(Number(comResult).toFixed(3)) a[b].v.v = isNaN(val) ? '' : val } }catch(error){ -- Gitblit v1.9.3