Critique my Javascript calculator

Hey,
Just finished my javascript calculator. Please critique it.
Note: The AC button is an on and off button of sorts, so to start using it you have to press AC first.

2 Likes

There are a few things:

  • unlimited zeros
  • unlimited decimal points
  • unlimited operators
  • .1*.2 = 0.020000000000000004

Thanks for the reply
I’ll do the appropriate editing

You can input unlimted zeros before anything else, e.g.: 000000004 instead of 4[quote=“ed-kahara, post:3, topic:72483”]
How should I handle decimal numbers?
[/quote]

You can limit the outputted answer to several decimals. That way things like 0.020000000000000004 will just show 0.02.
One way to do this: var answer = Math.round(answer*10000)/10000 which will give you 4 decimal precision.

And the rest of your reply is gone… :slight_smile:

I realized I understood what you meant after reading some guidelines.
Thankyou though. I will make the adjustments soon.

1 Like

Hey,
I got the chance to make all the changes today. Please critique it again and tell me what you think.

Hi, good job! Everything seems to work.

1 Like