From d9a66383e86863d4dc8193fb224333a4ea153aec Mon Sep 17 00:00:00 2001 From: UmakanthKaspa Date: Mon, 23 Dec 2024 18:44:01 +0530 Subject: [PATCH] fix: preserve trailing zeros in number formatting --- frontend/src2/helpers/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src2/helpers/index.ts b/frontend/src2/helpers/index.ts index f2218a3c..ced7f898 100644 --- a/frontend/src2/helpers/index.ts +++ b/frontend/src2/helpers/index.ts @@ -153,6 +153,7 @@ export function formatNumber(number: number, precision = 2) { precision = precision || guessPrecision(number) const locale = session.user?.country == 'India' ? 'en-IN' : session.user?.locale return new Intl.NumberFormat(locale || 'en-US', { + minimumFractionDigits: precision, maximumFractionDigits: precision, }).format(number) }