From 723c2653aef7f7c3563b90f4eba3c8f418329f57 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 15 Oct 2020 17:13:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9chart=20Y?= =?UTF-8?q?=E8=BD=B4=E4=B8=BA=E6=97=B6=E9=97=B4=E6=97=B6=E7=9A=84=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 --- nezha-fronted/src/components/charts/chartDataFormat.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js index 8e1e8b9f4..3592fb71e 100644 --- a/nezha-fronted/src/components/charts/chartDataFormat.js +++ b/nezha-fronted/src/components/charts/chartDataFormat.js @@ -372,6 +372,9 @@ function asciiCompute2(num,ascii,units,dot=2,unitIndex=0){ * unit:设置的单位 * */ function timeCompute(value,unit,dot=0){ + if(Number.isInteger(value)) { + dot=0; + } if(unit == 'year'){ return `${value.toFixed(dot)} ${unit}`; }