Created
May 9, 2017 14:19
-
-
Save zealot128/14331db48f3d0fc017d9a418af98c2d6 to your computer and use it in GitHub Desktop.
Vue2 filter thousand seperator / rounded (german comma)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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