From efee33f24955c3c869185ae87f5dc0514ca0a230 Mon Sep 17 00:00:00 2001 From: Sam Craig Date: Fri, 3 Nov 2023 09:35:21 -0400 Subject: [PATCH] fix: replace weight calculation with a rounded ceil --- lib/utils/DecisionUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/DecisionUtil.js b/lib/utils/DecisionUtil.js index 9dbb94a..c4a66ea 100644 --- a/lib/utils/DecisionUtil.js +++ b/lib/utils/DecisionUtil.js @@ -1013,7 +1013,7 @@ let DecisionUtil = { ) { // normalise the weights of all the shortlisted campaigns shortlistedCampaigns.forEach(campaign => { - campaign.weight = Math.floor(100 / shortlistedCampaigns.length); + campaign.weight = Math.ceil((100 / shortlistedCampaigns.length) * 10) / 10; }); // re-distribute the traffic for each camapign