mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-07-09 21:46:18 +08:00
[offers][feat] Add analysis to offers profile page (#416)
This commit is contained in:
@@ -321,18 +321,18 @@ export const offersAnalysisRouter = createRouter()
|
||||
similarOffers,
|
||||
);
|
||||
const overallPercentile =
|
||||
similarOffers.length === 0
|
||||
similarOffers.length <= 1
|
||||
? 100
|
||||
: (100 * overallIndex) / similarOffers.length;
|
||||
: 100 - (100 * overallIndex) / (similarOffers.length - 1);
|
||||
|
||||
const companyIndex = searchOfferPercentile(
|
||||
overallHighestOffer,
|
||||
similarCompanyOffers,
|
||||
);
|
||||
const companyPercentile =
|
||||
similarCompanyOffers.length === 0
|
||||
similarCompanyOffers.length <= 1
|
||||
? 100
|
||||
: (100 * companyIndex) / similarCompanyOffers.length;
|
||||
: 100 - (100 * companyIndex) / (similarCompanyOffers.length - 1);
|
||||
|
||||
// FIND TOP >=90 PERCENTILE OFFERS, DOESN'T GIVE 100th PERCENTILE
|
||||
// e.g. If there only 4 offers, it gives the 2nd and 3rd offer
|
||||
|
||||
Reference in New Issue
Block a user