Skip to content

Instantly share code, notes, and snippets.

@moklick
Created October 14, 2013 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moklick/6975707 to your computer and use it in GitHub Desktop.
Save moklick/6975707 to your computer and use it in GitHub Desktop.
functions to enforce german number formats
// from 1337 to 1.337
function formatNumber(number){
return (parseFloat(number) / 1000).toFixed(3).toString();
}
// from 12.123 to 12,123
function replacePoint(number) {
return number.toString().replace('.', ',');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment