From 07d9509db7c8e7b0ce1231389d42236901ef9aca Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Wed, 18 Oct 2023 08:37:56 +0300 Subject: [PATCH] fix: utilities format and change height func --- src/utilities.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/utilities.ts b/src/utilities.ts index 3881daba..2db499a0 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -60,13 +60,11 @@ export const formatToFixed4 = (value: string) => { } export const getHeightPercentages = (amountOfElements: number) => { - let percentages + let percentages = 100 - if (amountOfElements === 1) { - percentages = 100 - } else { + if (amountOfElements > 1) { percentages = 100 / amountOfElements } return `${percentages}%` -} \ No newline at end of file +}