Review my "JS Calculator"

I’ve just made my first big frond end project and would like some criticism.

http://gadzev.github.io/javascript-calculator/

This is a great looking calculator. The only problem i find is that adding fractions (0.1+0.2) doesn’t provide an answer at all…
Be careful with the floating point math issue. See the comments on th review of my calculator

1 Like

Yeah i just saw that. At first adding fractions worked fine but then i wanted to make it behave like a classic calculator so that it shows the results directly while you add operations. And then when i added that and you do for example (23-5*2) the result is 13 (which is correct) but the old very basic calculators would first subtract the 23-5 and then multiply the result by 2. When i added that to my calculator i had to change some of the code and i guess thats when i lost the fractions funcitonality.

But enough rambling time to fix this issue :D. Thanks for your comment @kendsr

very cool calculator, well done - love the solar panels!

JS and fractions… going to make me lose my mind… just realised that mine also treats them incorrectly, i.e 0.3 - 0.2 = 0.099999999999999999999999… to death.

1 Like