I have code, I use it in jquery
var string = "123,123";
$.trim(",");
Let I show it in source code:
function calculate_total_money() {
sum_money = 0;
$('table#table_product tr.data td#total_money').each(function() {
var _total_money = $(this).html();
if (_total_money != '') {
var total_money = _total_money;
sum_money += total_money;
}
});
$('table#table_product td#sum_total_money').html(formatNumber2(sum_money));}
This function return total money, but value of _total_money I get in table like that "23,123", but I want to convert it to Int 23123. I don't know how to do.
I want to delete comma in string, but it doesn't work. After delete comma, string must convert to Interger. I try many times but don't have anything happen. where's place I do wrong ?