Skip to content

Commit

Permalink
fix: Guarantee we wont break if called with empty number
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeelaudibert committed Dec 16, 2024
1 parent f2a8849 commit a424b59
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a424b59

Please sign in to comment.