Code review comment for lp:~rpadovani/ubuntu-calculator-app/closeBrackets150127

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Thanks Riccardo
Frankly I would like to go some different way. I would like to do not modify user formula.
I don't want want to calculator be smarter than human, and modify your formula, without chance to correct it.

My idea (I wasn't have time to implement it yet) is just displaying small popup window, with error message, eg:
- "(10*10=" "Missing closing bracket"
- "20+20*=" "Operator at the end of formula is not allowed"
And for validation (it will not allow you to add object to formula):
- "1234.56." "It is not allowed to add two decimal separator in the same number"
- "234**" "It is not allowed to add two operator at once"
- "1+)" "Too many closing bracers"

I could create mockup with that.

My idea to have two strict rules:
1. Do not modify user formula "(20+20*=" "Operator at the end of formula is not allowed")
2. But, validate user formula during typing ("1234.56." "It is not allowed to add two decimal separator in the same number")

I'm open for discussion. Please let me know what you think about that approach.

review: Needs Information

« Back to merge proposal