[offers][fix] Fix analysis bug that causes percentile to go negative

pull/522/head
Bryann Yeap Kok Keong 2 years ago
parent cc035387d7
commit a421a0d98a

@ -199,7 +199,7 @@ const calculatePercentile = (
const salary = getSalary(offer, lastOfferSalary); const salary = getSalary(offer, lastOfferSalary);
if (salary !== lastOfferSalary) { if (salary !== lastOfferSalary) {
if (salary === offerToCalculateSalary) { if (salary === offerToCalculateSalary && offerToCalculateIndex === -1) {
offerToCalculateIndex = i; offerToCalculateIndex = i;
} }
numberOfNoDuplicateOffers++; numberOfNoDuplicateOffers++;

Loading…
Cancel
Save