If you’re European like me, you’re probably used to this notation:
€ 366.432 instead of 366,432 or 366432.
// Number var money = 366432; // Convert to String and add dots every 3 digits var moneyDots = money.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1."); // Set in HTML $('.anywhere').text('€ ' + moneyDots);
Keep in mind that moneyDots is a String from now on! It’s not a number anymore!