tldr; http://codepen.io/amine_bens/full/rLbEGo/
i ‘finished’ my calculator challenge, i try to focus a lot on the design aspect to make my projects as appealing as i possibly can/know, would love to hear any suggestions or improvements i could try to add to it.
thank you campers
Nice and simple design
Maybe you can increase the font size a bit?
The number spill out of its box when there are too many digits.
The decimal point button stops working after clicking it once (try clicking it, then deleting it, then clicking it again; or click AC
after clicking it). It only starts to work again after I made a calculation.
1 Like
increase font: done.
decimal point : fixed ( i guess, would love if you could check it again ).
numbers spilling out: trying to come up wit a fix
thank you
I can now type a decimal point after clicking AC
, but I still can’t type it back after deleting it.
fixed that aswell thank you
0.2*0.1=0.020000000000000004
that is weird :o i couldn’t know what causes the issue, and i have no ide how to fix it
Even the sample calculator produces the same result
If I’m correct, 0.2
and 0.1
are not stored in memory exactly as 0.2 and 0.1, but rather as approximations to these numbers, because there’s no way to perfectly represent these numbers in binary. So you’re actually multiplying numbers that are not quite 0.2 and 0.1.
I checked out @BenGitter’s calculator and I wonder how that shows exactly 0.02
1 Like
thanks for clarifying the issue i’ll try to update my work with a solution the soonest possible
You can do this:
Math.round(answer*1000000)/1000000
This gives you 6 decimals. (Will only show if needed)
1 Like
Hi!
When you have the result of a calculation, and type a number, this number is added to the result. I think it should start a brand new calculation.
If you type 1000000000000000000000000000000000, numbers get out of the display. What I did is just have a digits limit. I was too lazy to implement scientific notation