From dd9cbcee331855c1b064fb348321519033519250 Mon Sep 17 00:00:00 2001 From: Palash Date: Thu, 30 Jun 2022 19:02:31 +0530 Subject: [PATCH] fix: decimal-precision is made undefined (#1344) Co-authored-by: Prashant Shahi --- frontend/src/components/Graph/yAxisConfig.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Graph/yAxisConfig.ts b/frontend/src/components/Graph/yAxisConfig.ts index 44377b6fc5..5d1eeb5da7 100644 --- a/frontend/src/components/Graph/yAxisConfig.ts +++ b/frontend/src/components/Graph/yAxisConfig.ts @@ -7,17 +7,13 @@ export const getYAxisFormattedValue = ( let decimalPrecision: number | undefined; const parsedValue = getValueFormat(format)( parseFloat(value), - 12, - 12, + undefined, + undefined, undefined, ); - try { const decimalSplitted = parsedValue.text.split('.'); - if ( - decimalSplitted.length === 1 || - parseFloat(parsedValue.text) === parseInt(parsedValue.text, 10) - ) { + if (decimalSplitted.length === 1) { decimalPrecision = 0; } else { const decimalDigits = decimalSplitted[1].split('');