From 881c45f062b1804f507ddf41c7c6c14de38ef607 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Wed, 30 Oct 2024 10:54:06 +0100 Subject: [PATCH] improve context & add log to browser --- src/utils/helpers/number.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/helpers/number.ts b/src/utils/helpers/number.ts index 403b7b154..0660c2a7b 100644 --- a/src/utils/helpers/number.ts +++ b/src/utils/helpers/number.ts @@ -167,7 +167,13 @@ export function prettifyNumber( try { formatter = new Intl.NumberFormat(locale, intlOptions); } catch (e) { - setContext('prettifyNumber', intlOptions); + const ctx = { + value: value.toString(), + intlOptions, + locale: locale ?? navigator.language, + }; + setContext('prettifyNumber', ctx); + console.error('[ERROR] prettifyNumber', ctx); captureException(e); if (intlOptions.minimumFractionDigits) { intlOptions.maximumFractionDigits = intlOptions.minimumFractionDigits + 1;