Just finished JS Calculator. Feedback please!

Hi campers,
here is the link. Needs your feedbacks :slight_smile:

Checked a few things:

  • Unlimited dots
  • Unlimited minuses
  • Unlimited zeros
  • Pressing more than 1 operator returns NaN
  • 0.1 * 0.2 = 0.200…4
  • Entering to much input will clear the the input
  • Entering a number and pressing = returns NaN

I will review codes for the first three. I placed control if number exceeds 13 calc. displays nothing and while you continue pressing numbers if amounts>20 it will display you “Err” message.

0.1*0.2=0,020000000 on my browser. The result is true but repeating zeros is a problem.

thank you for your feedback.

1 Like

It should end with a 4, it is because of the floating point error.

yes, it seems what is floating problem. I fixed it using toFixed() method.