Hi, I need help here. I do not manage to pass the test because of this error:
When the decimal element is clicked, a “.” should append to the currently displayed value; two “.” in one number should not be accepted
I couldn’t solve the problem. Please help.
jenovs
2
You sholdn’t be able to enter numbers like 1.3.4 (only one decimal per number, e.g. 1.4)
I know, but how to solve it?
ilenia
4
You can test if the current value has already a decimal point and make the action void if that is the case (make no action occur)
jenovs
5
Took me a while to find a bug
It’s in Container
-> inputBtn
:
var operators = /[+-\/*]/g;
Go to regexr.com, paste your regex and see what it matches.
1 Like
Thank you so much, I have solved the problem.
jenovs
7
You could’ve just fixed your regex:
var operators = /[+\-\/*]/g; // escape minus symbol
1 Like