var value1 = parseFloat(document.getElementById("inputA").value.replace(/,/, '.')) || 0; var value2 = parseFloat(document.getElementById("inputB").value.replace(/,/, '.')) || 0;