Skip to content

Commit 0b7d15e

Browse files
fixed parentheses issue harsh98trivedi#29
1 parent f2f158f commit 0b7d15e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

calc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ for (item of buttons) {
4141
} else {
4242
screen.classList.remove("negative");
4343
}
44-
} else if (isNumber(buttonText)) {
44+
} else if(buttonText=="(" || buttonText==")") {
45+
if(flag==1){
46+
flag =0;
47+
}
48+
screenValue+=buttonText;
49+
screen.value=screenValue;
50+
}
51+
else if (isNumber(buttonText)) {
4552
if (flag == 1) {
4653
screenValue = buttonText;
4754
flag = 0;

0 commit comments

Comments
 (0)