Skip to content

Instantly share code, notes, and snippets.

@Panigale

Panigale/filters.js

Created Jan 25, 2017
Embed
What would you like to do?
function currency(value){
value += "";
var arr = value.split(".");
var re = /(\d{1,3})(?=(\d{3})+$)/g;
return arr[0].replace(re, "$1,") + (arr.length == 2 ? "." + arr[1] : "");
}
export {currency};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment