Skip to content

Instantly share code, notes, and snippets.

@coreequip
Created August 6, 2014 08:36
Show Gist options
  • Save coreequip/a8f162d1bb657b25d3cd to your computer and use it in GitHub Desktop.
Save coreequip/a8f162d1bb657b25d3cd to your computer and use it in GitHub Desktop.
Tausender-Trennzeichen als Oneliner in JavaScript
wert = (" ".substr(0, v1 = 3 - (v2 = wert.toString().length % 3)) + wert).replace(/(.{3})/g, ".$1").substr(v1 + (v2 ? 1 : 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment