Skip to content

Commit

Permalink
fix: fixed the completion to two decimal points,showing complete when…
Browse files Browse the repository at this point in the history
… totalpoints match threshold
  • Loading branch information
manish-singh-bisht committed May 17, 2024
1 parent 1dc82d3 commit ea42955
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ui/levelDetailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const LevelDetailCard = ({
currentLevelOfUser,
nextLevelForUser
);
const isLevelCompleted = idx <= sortedLevels.length - 1 && totalPoints > sortedLevels[idx].pointThreshold;
const isLevelCompleted = idx <= sortedLevels.length - 1 && totalPoints >= sortedLevels[idx].pointThreshold;
const completedCurrentLevelPercentage = progressMadeInThisLevel * 100;
const isNotStarted = totalPoints < level.pointThreshold;

Expand All @@ -51,7 +51,7 @@ const LevelDetailCard = ({
levelStatus = `Not started`;
progressBarStatus = 0;
} else {
levelStatus = `${completedCurrentLevelPercentage}% Complete`;
levelStatus = `${completedCurrentLevelPercentage.toFixed(2)}% Complete`;
progressBarStatus = progressMadeInThisLevel;
}

Expand Down

0 comments on commit ea42955

Please sign in to comment.