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

This commit is contained in:
Bryann Yeap Kok Keong
2022-11-07 03:12:44 +08:00
parent cc035387d7
commit a421a0d98a

View File

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