Closed lefterisgar closed 1 year ago
Instead of blocking buttons, it will be better to replace the previous symbol when you click on another
Instead of blocking buttons, it will be better to replace the previous symbol when you click on another
Yes, my approach is wrong.
I've rewritten it from scratch! What do you think now? If you find any issues, let me know. 😀
I found a small bug, if I write 5x2
, then I add a % between the 5 and the x, it will replace the x with the % (result : 5%2
instead of 5%x2
)
I found a small bug, if I write
5x2
, then I add a % between the 5 and the x, it will replace the x with the % (result :5%2
instead of5%x2
)
Is it fixed now?
It looks perfect
Code-wise it's terrible but I trust you :)
I found another bug. If I write -5-
, then if I set the cursor at the position 0 and I click to + for example, the result will be -5+
instead of +5-
Otherwise I think the code can be slightly simplified for more clarity
And the final bug is with the decimal separator symbol and the grouping separator symbol. For example if I write "5,555", the comma will be replaced if a add a + next to the comma. In addition do not forget that every country has its own separator, use the variable instead of writing it manually 😀 I will check tomorrow if there is more issues
And the final bug is with the decimal separator symbol and the grouping separator symbol. For example if I write "5,555", the comma will be replaced if a add a + next to the comma. In addition do not forget that every country has its own separator, use the variable instead of writing it manually grinning I will check tomorrow if there is more issues
Hey! Everything you reported should be fixed now. However the code leaves a lot to be desired. It needs a refactor because it looks anything but clean...
Small bug: Type "sq" "-" and then press "+". It will display: "sq" "+".
Small bug: Type "sq" "-" and then press "+". It will display: "sq" "+".
I did not understand the bug, sorry
Small bug: Type "sq" "-" and then press "+". It will display: "sq" "+".
I did not understand the bug, sorry
No problem! I just realized that you aren't supposed to enter minus when inside a square root. However there is another related bug I found.
If you type an empty square root and then press a symbol (for example division) it will be accepted. Then we will have √/ or √^ for example. This shouldn't be allowed.
Should be good now.
This PR attempts to fix #126. It disables certain buttons, like divide or multiply if another symbol has been typed without a number separating the two. Only issue is that if you press for example the plus (+) button by accident, and you want a subtraction, clicking the minus (-) button will do nothing. You need to erase the + and then enter the -. Code-wise I think it doesn't look any clean but you will hopefully be able to make it better :)