Skip to content

Instantly share code, notes, and snippets.

@EQuimper
Created May 25, 2017 20:35
Show Gist options
  • Save EQuimper/788c958dabd1cf9ff43b79e9c8589c3f to your computer and use it in GitHub Desktop.
Save EQuimper/788c958dabd1cf9ff43b79e9c8589c3f to your computer and use it in GitHub Desktop.
Thousand with comma
export function commaThousand(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment