From 48649f3f206dcd556bda72970570a60ca6186059 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期六, 10 八月 2024 16:54:03 +0800 Subject: [PATCH] 更新科学计数法 --- static/js/worker.js | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/static/js/worker.js b/static/js/worker.js index e9efd59..580ae6e 100644 --- a/static/js/worker.js +++ b/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 -- Gitblit v1.9.3