Add helper for 4 fraction digit percentages

This commit is contained in:
Riordan Panayides 2022-09-25 23:19:01 +02:00
parent e7677f2688
commit 89f5ff453f
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,12 @@ export const percentFormat = new Intl.NumberFormat(undefined, {
maximumFractionDigits: 3,
})
export const percentFormat4D = new Intl.NumberFormat(undefined, {
style: 'percent',
minimumFractionDigits: 1,
maximumFractionDigits: 4,
})
export function floorToDecimal(
value: number,
decimals: number | undefined | null