jesslourenco / calculator-app

A friendly calculator app that helps you to do simple math :D Currently made in vanilla JS.
MIT License
0 stars 0 forks source link

Allow user to implicit zero in decimal numbers #3

Open jesslourenco opened 3 years ago

jesslourenco commented 3 years ago

Users should be allowed to start a decimal number smaller than zero by pressing the decimal separator button ('.'). For example, in addition to pressing 0.53, they should also be able to use .53 for the calculation.

Currently, the application allows for the first decimal value in the expression to be formatted in that manner, but not the second one.

Steps to reproduce: 1 - Input number .05 in the app 2 - Click on the plus sign button Expected outcome: The user should be able to input another number with an implicit zero, eg. 0.3 Actual outcome: Decimal separator button is in "pressed" state, not allowing to be pressed again.

Technical notes: A possible solution might be to simply adjust the code so it cleans this pressed state of the decimal separator button every time an operator sign button is clicked.