Skip to content

Commit

Permalink
feat(tables): Display 0 global coverage as <0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Oct 24, 2024
1 parent b4f907c commit 8d9bd74
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ export const useColumns = (
),
cell: ({ row }) => {
const { global_contribution: value } = row.original;
if (!value) return t('no-data');
const formattedValue = cellFormatter.percentage(locale, value);
if (value === undefined || value === null) return t('no-data');
const formattedValue = cellFormatter.percentage(locale, value, {
displayPercentageSign: false,
displayZeroValue: false,
});
return <span className="text-xs">{t('percentage', { percentage: formattedValue })}</span>;
},
},
Expand Down

0 comments on commit 8d9bd74

Please sign in to comment.