Skip to content

Instantly share code, notes, and snippets.

@kingisaac95
Created November 29, 2021 13:16
Show Gist options
  • Save kingisaac95/6851e8b0ad1ad527886872cced6d5c37 to your computer and use it in GitHub Desktop.
Save kingisaac95/6851e8b0ad1ad527886872cced6d5c37 to your computer and use it in GitHub Desktop.
Add comma separation in numbers
const formatCount = (x) => x.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