The Case of the Repeating Decimal - JS calculator

The Case of the Repeating Decimal - JS calculator
0

#1

Here is my code for the JS calculator - http://codepen.io/docwali777/pen/ALPGBm

How do I prevent multiple decimals from being added…?


#2

Modify your decimal code to no longer add if number contains decimal, I just wrote this as example on the fly:

$("#period").click(function() {
    if ($("#numberInput").text().indexOf('.') == -1) {
        $("#numberInput").append(".");
    }
});

#4

Thank you very much… It worked…!!!

I solved two problem with your solutions…