How to add dots every 3 digits in currency values with JavaScript
If you’re European like me, you’re probably used to this notation: € 366.432 instead of 366,432 or 366432. In order to get this done in JavaScript you want to do the following: // 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 […]