I'm working on a price calculation table on Wordpress using jQuery. I want to space my numbers when the result are in thousands.
Converting this: 1000 into this: 1 000
I tried several jQuery scripts but they all got rid of my .toFixed(2)
var min = 0;
var max = 500000;
jQuery( "#input" ).keyup(function() {
if(jQuery("#input").val() < max && jQuery("#input").val() >= min && jQuery("#input").val() < 1000 ) {
var val = jQuery("#input").val() * jQuery(".price1").val();
jQuery('#amount1').html(val.toFixed(2));
}
});
At the moment the total price is displayed like this: total price: 2349.30$
I'm trying to convert it like this: total price: 2 349.30$