From 63ab36f4d24b8b96e3a231ffef374ca058744beb Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Wed, 8 Feb 2023 15:54:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=95=E4=BD=8D=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=82=E6=95=B0=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=BF=94=E5=9B=9E=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/unit-convert.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/unit-convert.js b/src/utils/unit-convert.js index c949b5cf..7c90587b 100644 --- a/src/utils/unit-convert.js +++ b/src/utils/unit-convert.js @@ -17,6 +17,9 @@ function asciiCompute (num, ascii = 1000, units, dot = 2) { return ['', ''] } num = Number(num) + if (num === 0) { + return [0, ''] + } let carry = 0 if (num > 1) { const log = Math.log(num) / Math.log(ascii)