From 9a0b34eab86ceceb0cc33356ad891288de63e3b1 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:18:45 +0530 Subject: [PATCH] fix(nc-gui): implement display of decimal values with trailing zeros using toFixed() (#9464) --- packages/nocodb-sdk/src/lib/helperFunctions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/helperFunctions.ts b/packages/nocodb-sdk/src/lib/helperFunctions.ts index 3d6374e9d9..194fec97c8 100644 --- a/packages/nocodb-sdk/src/lib/helperFunctions.ts +++ b/packages/nocodb-sdk/src/lib/helperFunctions.ts @@ -186,9 +186,9 @@ function roundUpToPrecision(number: number, precision: number = 0) { let pair = `${number}e`.split('e'); const value = Math.round(Number(`${pair[0]}e${+pair[1] + precision}`)); pair = `${value}e`.split('e'); - return +`${pair[0]}e${+pair[1] - precision}`; + return (+`${pair[0]}e${+pair[1] - precision}`).toFixed(precision); } - return Math.round(number); + return Math.round(number).toFixed(precision); } export {