From cba8a94c53835209b6c4906af1ca785546adb710 Mon Sep 17 00:00:00 2001 From: Rafa Audibert Date: Mon, 16 Dec 2024 14:29:19 -0300 Subject: [PATCH] fix: Guarantee we wont break if called with empty number --- frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx b/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx index 940c7a47a4d8d8..38ce8be4ef9771 100644 --- a/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx +++ b/frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx @@ -45,7 +45,7 @@ const VariationCell = ( { isPercentage, reverseColors }: VariationCellProps = { isPercentage: false, reverseColors: false } ): QueryContextColumnComponent => { const formatNumber = (value: number): string => - isPercentage ? `${(value * 100).toFixed(1)}%` : value.toLocaleString() + isPercentage ? `${(value * 100).toFixed(1)}%` : value?.toLocaleString() ?? '(empty)' return function Cell({ value }) { const { compareFilter } = useValues(webAnalyticsLogic)