Skip to content

Commit

Permalink
Merge pull request #514 from interlay/tom/percentage-utility-bug
Browse files Browse the repository at this point in the history
fix: percentage utility
  • Loading branch information
tomjeatt committed Sep 16, 2022
2 parents d0c20a1 + 6b3fb77 commit e3632ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ const formatPercentage = (
}
): string => {
const { format } = new Intl.NumberFormat(undefined, {
style: 'percent',
style: 'decimal',
maximumFractionDigits: options?.maximumFractionDigits ?? 2,
minimumFractionDigits: options?.minimumFractionDigits ?? 2
});

return format(percentage);
return `${format(percentage)}%`;
};

function displayMonetaryAmount(amount: MonetaryAmount<CurrencyExt> | undefined, defaultValue = '0.00'): string {
Expand Down

2 comments on commit e3632ce

@vercel
Copy link

@vercel vercel bot commented on e3632ce Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e3632ce Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.