Skip to content

Commit

Permalink
fixed faulty regex for recurring decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
angaaruriakhil committed Sep 2, 2021
1 parent e2702a0 commit 84da27d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function calculateAnswer() {
} // If the number is recurring, then round it.


regexRecurring = /(\d)\2+/;
regexRecurring = /\.(\d)\1+/;

if (regexRecurring.test(answer)) {
return answer.toFixed(1) + " (Recurring)";
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function calculateAnswer() {
}
}
// If the number is recurring, then round it.
regexRecurring = /(\d)\2+/
regexRecurring = /\.(\d)\1+/;
if (regexRecurring.test(answer)) {
return answer.toFixed(1) + " (Recurring)";
} else {
Expand Down

0 comments on commit 84da27d

Please sign in to comment.