From 3116b46a6cecdca10f61517e7037837fbdf1d9f6 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Mon, 13 Jan 2025 18:57:26 +0100 Subject: [PATCH] improve format --- misc/format.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/format.ts b/misc/format.ts index ca3a8cc..852d1fa 100644 --- a/misc/format.ts +++ b/misc/format.ts @@ -5,6 +5,8 @@ export function useNumberFormat() { const { i18n } = useTranslation(); return (number: number, digits = 2, currency = null) => { + if(number == undefined) + return null; if (currency) { if ((Math.round(number * (10 ** digits)) / (10 ** digits)) === 0) return "---";