0
In a table that has one of the columns I want to add are with comma as decimal.
as I do to add these values?
At the moment I’m using this function but don’t add up the numbers after decimal.
function sum() {
var table = document.getElementById("table1");
var sumVal = 0;
for(var i = 1; i < table.rows.length; i++)
sumVal = sumVal + parseInt(table.rows[i].cells[3].innerHTML);
var sumValTest = "Total nao incluido = " + sumVal;
document.getElementById("val").innerHTML = sumValTest;
console.log(sumVal);
}
You have to replace the comma by a dot.
– Sam
@Sam, you and my hero... perfect thanks for the syntax. How would I move the house of thousands if I have a value of 1,500.50?
– user2916405
I updated the answer.
– Sam
yes of course Augusto, with pleasure. I am novice here. Thank you for the instruction.
– user2916405