I have code that calculate value in HTML table. It works if I use .(dot) but not when I use ,(comma)
also my numbers have space if number bigger than 1000 example 2 476,98
how can I make it working as I need?
Javascript:
var totals = [0, 0, 0, 0, 0, 0];
$(document).ready(function () {
var $dataRows = $("#sum_table tr:not('.totalColumn, .titlerow')");
$dataRows.each(function () {
$(this).find('.rowDataSd').each(function (i) {
totals[i] += parseFloat($(this).html());
});
});
$("#sum_table td.totalCol").each(function (i) {
$(this).html("kopā: " + totals[i].toFixed(2));
});
});
And here its on jsfiddle