From 5b65481f7f4ed873d1a592e0f6b33de51630b3e1 Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Wed, 23 Oct 2024 02:10:59 +0000 Subject: [PATCH] Update number.ts --- tauri-app/src/lib/utils/number.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tauri-app/src/lib/utils/number.ts b/tauri-app/src/lib/utils/number.ts index 2ca9c4962..59da9ef1e 100644 --- a/tauri-app/src/lib/utils/number.ts +++ b/tauri-app/src/lib/utils/number.ts @@ -16,7 +16,8 @@ export function bigintStringToPercentage( valueDecimals: number, finalDecimalsDigits?: number, ): string { - const finalDecimals = finalDecimalsDigits !== undefined ? finalDecimalsDigits : valueDecimals; + const finalDecimals = + typeof finalDecimalsDigits !== 'undefined' ? finalDecimalsDigits : valueDecimals; let valueString = formatUnits(BigInt(value) * 100n, valueDecimals); const index = valueString.indexOf('.'); if (index > -1) {