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) {