From e97469038b3f59b90014c381d5d9b03659778a0d Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Tue, 14 Nov 2023 09:18:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E5=90=8D=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/phdHelper.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/phdHelper.js b/src/utils/phdHelper.js index 567c14e..67991b3 100644 --- a/src/utils/phdHelper.js +++ b/src/utils/phdHelper.js @@ -1,4 +1,4 @@ -import BigNumber from "bignumber.js" +import BigNumber from 'bignumber.js' /** * PHD 类型 @@ -20,7 +20,7 @@ export const isSample = dataType => { } export const getSampleTypeIdentify = dataType => { - if(isSample(dataType)) { + if (isSample(dataType)) { return 'S' } else { switch (dataType) { @@ -92,8 +92,9 @@ export class PHDParser { this.fileType = headerInfoLine1[2] this.qualify = headerInfoLine1[4] - const liveTime = parseFloat(this.getBlockStr('Acquisition', 0, 3)) - this.liveTime = BigNumber(liveTime).toPrecision(6) + let liveTime = parseFloat(this.getBlockStr('Acquisition', 0, 3)) + liveTime = BigNumber(liveTime).toPrecision(6) + this.liveTime = liveTime.endsWith('.0') ? parseInt(liveTime) : parseFloat(liveTime) // 如果解析的是sample 文件,则解析相关联的文件 if (this.isSample) {