Skip to content

Instantly share code, notes, and snippets.

@zealot128
Created May 9, 2017 14:19
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 zealot128/14331db48f3d0fc017d9a418af98c2d6 to your computer and use it in GitHub Desktop.
Save zealot128/14331db48f3d0fc017d9a418af98c2d6 to your computer and use it in GitHub Desktop.
Vue2 filter thousand seperator / rounded (german comma)
Vue.filter('formatNumber', function (value) {
const rounded = Math.round(value * 100) / 100
return rounded.toString().replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment