mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-03-02 03:50:40 +00:00
feat: create util func to get percentages of height
This commit is contained in:
parent
36c27aa9f1
commit
302eab433d
@ -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}%`
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user