mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-11 19:33:27 -05:00
fix: summary calculation (#4500)
This commit is contained in:
committed by
GitHub
parent
bd8724c1e2
commit
74b770a937
@@ -399,7 +399,7 @@ export const getQuestionSummary = async (
|
||||
value: label,
|
||||
count,
|
||||
percentage:
|
||||
totalSelectionCount > 0 ? convertFloatTo2Decimal((count / totalSelectionCount) * 100) : 0,
|
||||
totalResponseCount > 0 ? convertFloatTo2Decimal((count / totalResponseCount) * 100) : 0,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -408,8 +408,8 @@ export const getQuestionSummary = async (
|
||||
value: getLocalizedValue(lastChoice.label, "default") || "Other",
|
||||
count: otherValues.length,
|
||||
percentage:
|
||||
totalSelectionCount > 0
|
||||
? convertFloatTo2Decimal((otherValues.length / totalSelectionCount) * 100)
|
||||
totalResponseCount > 0
|
||||
? convertFloatTo2Decimal((otherValues.length / totalResponseCount) * 100)
|
||||
: 0,
|
||||
others: otherValues.slice(0, VALUES_LIMIT),
|
||||
});
|
||||
@@ -452,8 +452,8 @@ export const getQuestionSummary = async (
|
||||
imageUrl: choice.imageUrl,
|
||||
count: choiceCountMap[choice.id],
|
||||
percentage:
|
||||
totalSelectionCount > 0
|
||||
? convertFloatTo2Decimal((choiceCountMap[choice.id] / totalSelectionCount) * 100)
|
||||
totalResponseCount > 0
|
||||
? convertFloatTo2Decimal((choiceCountMap[choice.id] / totalResponseCount) * 100)
|
||||
: 0,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ export const ContactsPage = async ({
|
||||
contactAttributeKeys={contactAttributeKeys}
|
||||
isReadOnly={isReadOnly}
|
||||
initialContacts={initialContacts}
|
||||
hasMore={initialContacts.length <= ITEMS_PER_PAGE}
|
||||
hasMore={initialContacts.length >= ITEMS_PER_PAGE}
|
||||
refreshContacts={refreshContacts}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user