Hi fellows,
I working on the Calculator project for the second time and I really struggling with FCC validation package!!
here is My Code
Click the top left green burger button and run tests for javascript calculator, the result will be 11/16 !! then try to perform the same operation in the test and you will get the same results as the test!! that’s weird
Another thing: test case 13 has something wrong! how can I perform 5* -5 and at the same time if the user clicked an operator and the very last clicked button is an operator, the new one should replace the old one !!
When I try to write 1.5 in your calculator I get 10.5, as soon as I press the dot the number is multiplied by 10 - many of tests do not pass because of this
The 5* -5 one, means you are not allowing to multiply or divide with negative numbers.
In fact the test say:
If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign.
It means you need to allow to make the next inputted number a negative number