I am doing a calculation and the result from that operation goes into an input text, many times the result comes in thousands and I want to show them with a "," for example insted of 100000 it must show 100,000 but I can't find something that fits my proyect, someone have an idea ?
//Here I do the math
function calcular_total() {
importe_total = 0
var totalC = 0
$("#table1 #tb1 .item").each(function (){
var ku1 = $(this).find('.precio').text().replace('$', '');
var ku2 = $(this).find('.importe .imp').val();
totalC += ku1*ku2;
});
$("#total").val(totalC.toFixed(2));
}
//The result goes here
<label style="font-family: 'Raleway', sans-serif;" for="total">Total: </label> <span class="currencyinput">$<input type="text" id="total" name="total" value="0" readonly/></span>