How to transform a number like 12343778 into 12.343.778

/* ------ HTML <div id="result">12343778</div> */ var delimiter = '.'; $('#result').html() .toString() .replace(new RegExp("(^\\d{"+($this.html().toString().length%3||-1)+"})(?=\\d{3})"),"$1" + delimiter) .replace(/(\d{3})(?=\d)/g,"$1" + delimiter);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.