I tried making a calculator and almost completed, but)
3 of 16 tests didn’t pass, even when app works as expected according to user stories
Here is my calculator
https://codepen.io/papajango/pen/vopBZR
These tests have failed but app works correctly:
11. When the decimal element is clicked, a “.” should append to the currently displayed value; two “.” in one number should not be accepted
'An input of "5 . 5 . 5" should display 5.55 '
13. If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign.
14. If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign.
16. My calculator should have several decimal places of precision when it comes to rounding (note that there is no exact standard, but you should be able to handle calculations like “2 / 7” with reasonable precision to at least 4 decimal places)
Can you tell what’s wrong?
Thank you