Critique my Javascript calculator

Critique my Javascript calculator
0.0 0

#1

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

There are a few things:

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

#3

Thanks for the reply
I’ll do the appropriate editing


#4

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:


#5

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


#6

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


#7

Hi, good job! Everything seems to work.