licp
2024-08-10 48649f3f206dcd556bda72970570a60ca6186059
更新科学计数法
已修改1个文件
4 ■■■ 文件已修改
static/js/worker.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js
@@ -325,7 +325,7 @@
            isPoint = PROJECT=='装备电缆'&&tell&&tell.length>0&&typeof tell[0] =='string'&&tell[0].includes('/') // 判断要求值是否为分数
            comResult = compute(item.v.f.replace(/=/g, ' '),comValue, isPoint)
            let list3 = list2.map(item=>item+'')
            isToExponential = list3.some(val => val.includes('e+'))
            isToExponential = list3.some(val => val.includes('e+')||val.includes('e-'))
            // 装备项目检验值转化
            if (PROJECT === '装备电缆' && isToExponential) {
              let num2 = new Big(comResult)
@@ -368,6 +368,8 @@
                      let str = a[b].v.ct.fa.split('.')[1]
                      num = str.length
                      a[b].v.v = comResult?Number(comResult).toFixed(num):comResult
                    }else if(comResult.includes('e+')|| comResult.includes('e-')){
                      a[b].v.v = comResult
                    }else{
                      let val = parseFloat(Number(comResult).toFixed(3))
                      a[b].v.v = isNaN(val) ? comResult : val