mohitahlawat2001 / calculator-app

https://mohitahlawat-calculator-app.netlify.app/
4 stars 23 forks source link

fix: NaN result on toggle negative/positive number #19

Closed Dimas-Saputra-Me closed 1 year ago

Dimas-Saputra-Me commented 1 year ago

Fix: Issue #3

So if we trying to do an equation like 8 - -8 or 8 x -2 x -2 we will get NaN as a result display. I have made a few changes inside if (text === "+/-") function to fix the issue.

Here is the output before fix (stated in issue #3): image

Here is the output after the fix: res

Let me know if there is a feedback or I need to do something on this. Thanks in advance