Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better placement of parentheses inside existing calculations #213

Closed
Markus40 opened this issue Mar 5, 2023 · 3 comments
Closed

Better placement of parentheses inside existing calculations #213

Markus40 opened this issue Mar 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Markus40
Copy link

Markus40 commented Mar 5, 2023

When modifying existing calculations, parentheses are always opened first and closed if there is an excess bracket to the left, even if it makes no sense to do so. Placing the closing/right parentheses first or using nested parentheses is tedious.

Ideally, parentheses should open towards a number and close away from an operator.

Even with the changes, it would be nice to be able to have separate buttons for right and left parentheses, or to split the existing button into two.

@Darkempire78 Darkempire78 added the enhancement New feature or request label Mar 5, 2023
@Markus40
Copy link
Author

Markus40 commented Mar 5, 2023

Here a few cases that could cause problems.

When a new parentheses is placed between already existing parentheses it should also be open towards the next number and away from operators:
((1+2)*3)^2 --> (((1+2)*3)^2

Multiplication by juxtaposition should be treated like normal multiplication. A new parentheses after the 2 should open to the right:
2(-1+3) --> 2((-1+3)

@Darkempire78
Copy link
Owner

@Markus40 I updated the parenthesis system in the v2.1.4, can you test it please ? https://github.com/Darkempire78/OpenCalc/releases/tag/v2.1.4

@Markus40
Copy link
Author

Markus40 commented Mar 6, 2023

@Darkempire78 Some mistakes are still made when there are no extra open parentheses in front:
1+2×3 --> 1+2(×3
1×2+(3+4)+5 --> 1×2+(3+4)(+5

I have not found any other problems.

@Darkempire78 Darkempire78 added bug Something isn't working and removed enhancement New feature or request labels Mar 7, 2023
@Darkempire78 Darkempire78 added this to the 2.2.0 milestone Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants