Calculator html

Good morning. I’m trying build a calculator with all that I learned till now but I found a small issue wich I can not find solution yet. The problem is when I press on button (dot ‘.’) 2 times will appear 2 times but I won’t it, I won’t he keep repeating this. I will show my code.

            <input type="button" value="." onClick="document.calculator.display.value+='.'">

You’ll need to check to see if a dot is already there and if it is then ignore any more inputs from that field. Should be able to achieve it with a simple if statement.