Skip to content

Instantly share code, notes, and snippets.

@tomraithel
Created January 7, 2013 13:34
Show Gist options
  • Select an option

  • Save tomraithel/4475011 to your computer and use it in GitHub Desktop.

Select an option

Save tomraithel/4475011 to your computer and use it in GitHub Desktop.
js | coffeescript: German number format
= (number) ->
stringReverse = (str)->
str.split('').reverse().join('')
[preComma, postComma] = number.toFixed(2).split('.')
preComma = stringReverse(stringReverse(preComma).match(/.{1,3}/g).join('.'))
"#{preCom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment