feat: create util func to get percentages of height

This commit is contained in:
RadoslavDimchev 2023-10-18 08:27:38 +03:00
parent 36c27aa9f1
commit 302eab433d

View File

@ -58,3 +58,15 @@ export const formatToFixed4 = (value: string) => {
}
return value
}
export const getHeightPercentages = (amountOfElements: number) => {
let percentages
if (amountOfElements === 1) {
percentages = 100
} else {
percentages = 100 / amountOfElements
}
return `${percentages}%`
}