My calculator seems to work perfectly well but it’s failing to pass some user stories event though it’s working perfectly. Can anyone help ? i’m failing user story 9,12,13 and 14. But when you use the calculator, it works very fine except for the fact that it can’t handle multiple zeros after the operator sign, is there a way i can also fix that bug?
Carefully reading the error messages often helps to identify the problem, for example this:
I should be able to perform any operation (+, -, *, /) on numbers containing decimal points
The expression “10.5 - 5.5” should produce an output of “5” : expected ‘10.5 - 5.5 = 5’ to equal ‘5’
This means that you’re putting the whole string ‘10.5 - 5.5 = 5’ into the <div id="display">, but it should be only the result.
It’s possible that you suddenly pass all tests when you fix that.
You’re already doing some sort of input validation for the decimal point, which is working fine. You can surely do something similar for multiple zeroes? Something along the lines “if the current number is zero, don’t allow entering more zeroes”. Neat styles btw.