Skip to content

Commit

Permalink
Update boys.js
Browse files Browse the repository at this point in the history
revered order of find percentile
  • Loading branch information
StrongereCommerce authored Sep 18, 2023
1 parent 0d82517 commit 814154a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions assets/js/boys.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ function calculateFitForBoys(heightFeet, heightInches, weight, age) {
}

function findPercentile(value, percentiles) {
const breakpoints = [5, 10, 15, 25, 50, 75, 85, 90, 95];
for (let i = 0; i < percentiles.length; i++) {
if (value <= percentiles[i]) {
return breakpoints[i];
}
}
return 95;
const breakpoints = [95, 90, 85, 75, 50, 25, 15, 10, 5]; // Adjusted order
for (let i = 0; i < percentiles.length; i++) {
if (value >= percentiles[i]) {
return breakpoints[i];
}
}
return 5;
}

function calculateSizeAndFit() {
Expand Down

0 comments on commit 814154a

Please sign in to comment.