JavaScript

JavaScript: numbers with decimal (thousand) separator

Sven Bachmann
Today, I needed a JavaScript function that converts a number like 1234567 to something more beautiful like 1.234.567. And because I didn’t need to take notice of locale settings (like using a comma instead of a dot) most solutions on the web where just too much for me and I decided to write my own.Mainly its a 3-liner, but packed in a function it becomes a little more. Feel free to use it for your own: