Skip to content

Commit

Permalink
Merge pull request #2113 from DuckySoLucky/fixPetMilestonePercentage
Browse files Browse the repository at this point in the history
fix: pet milestone percentage being NaN
  • Loading branch information
metalcupcake5 authored Dec 3, 2023
2 parents 62545c6 + eb4701d commit ed58f16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stats/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function getPetMilestone(type, amount) {
amount: amount ?? 0,
rarity: constants.MILESTONE_RARITIES[constants.PET_MILESTONES[type].findLastIndex((x) => amount >= x)] ?? "common",
total: constants.PET_MILESTONES[type].at(-1),
progress: Math.min((amount / constants.PET_MILESTONES[type].at(-1)) * 100, 100).toFixed(2),
progress: amount ? Math.min((amount / constants.PET_MILESTONES[type].at(-1)) * 100, 100).toFixed(2) : 0,
};
}

Expand Down

0 comments on commit ed58f16

Please sign in to comment.