serso / android-calculatorpp

Android Calculator
421 stars 201 forks source link

Allowing multiple decimal points #178

Open areebbeigh opened 7 years ago

areebbeigh commented 7 years ago

The calculator doesn't prevent you from inserting more than one decimal points:

screenshot_2016-11-30-21-49-04-424_org solovyev android calculator

GuilhermeRossato commented 7 years ago

Why should it behave otherwise?

Notice the color of your answer lightened when you put the second decimal point, indicating that your expression became invalid.

Consider entering 3+( on the calculator, it is just as much illegal to be missing a closing tag, but it is working under the assumption that you will eventually finish your expression (and therefore correct it).

areebbeigh commented 7 years ago

@GuilhermeRossato it's just kind of a convention. Wouldn't hurt to prevent the user from entering invalid input. Also of the number is long (20-30 digits) and you accidently placed 2 decimal points somewhere in the beginning one would have a hard time correcting the number.