From d6a234bac54fa644a8d9456b05ec435810b43113 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 13 Nov 2023 15:56:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DtoPrecision=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/utils/phdHelper.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index baa5348..05f4358 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@toast-ui/editor": "^2.1.2", "ant-design-vue": "^1.7.2", "axios": "^0.18.0", + "bignumber.js": "^9.1.2", "china-area-data": "^5.0.1", "clipboard": "^2.0.4", "codemirror": "^5.46.0", @@ -131,4 +132,4 @@ "last 2 versions", "not ie <= 10" ] -} \ No newline at end of file +} diff --git a/src/utils/phdHelper.js b/src/utils/phdHelper.js index df5a33e..567c14e 100644 --- a/src/utils/phdHelper.js +++ b/src/utils/phdHelper.js @@ -1,3 +1,5 @@ +import BigNumber from "bignumber.js" + /** * PHD 类型 */ @@ -91,7 +93,7 @@ export class PHDParser { this.qualify = headerInfoLine1[4] const liveTime = parseFloat(this.getBlockStr('Acquisition', 0, 3)) - this.liveTime = parseFloat(liveTime.toPrecision(6)) + this.liveTime = BigNumber(liveTime).toPrecision(6) // 如果解析的是sample 文件,则解析相关联的文件 if (this.isSample) {