From d30ffdc5b7bca77214d55e59f82dfb7680038db8 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Fri, 29 Nov 2024 20:14:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=A0=BC=E5=BC=8F=E5=90=8E=E7=9A=84=E5=80=BC?= =?UTF-8?q?=E5=87=BA=E7=8E=B0-0=E6=88=96=E8=80=85-0.00=EF=BC=88=E5=8D=B3?= =?UTF-8?q?=E8=B4=9F=E9=9B=B6=EF=BC=89=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E8=A7=86=E4=B8=BA0=E6=88=96=E8=80=850.00=20#13222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/js/formatter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/js/formatter.ts b/core/core-frontend/src/views/chart/components/js/formatter.ts index da44cdfe80..689d7bcefc 100644 --- a/core/core-frontend/src/views/chart/components/js/formatter.ts +++ b/core/core-frontend/src/views/chart/components/js/formatter.ts @@ -51,7 +51,11 @@ function transUnit(value, formatter) { } function transDecimal(value, formatter) { - return value.toFixed(formatter.decimalCount) + const resultV = value.toFixed(formatter.decimalCount) + if (Object.is(parseFloat(resultV), -0)) { + return resultV.slice(1) + } + return resultV } function transSeparatorAndSuffix(value, formatter) {