Skip to content

Instantly share code, notes, and snippets.

@batako
Created September 11, 2012 08:17
Show Gist options
  • Save batako/3696854 to your computer and use it in GitHub Desktop.
Save batako/3696854 to your computer and use it in GitHub Desktop.
3桁カンマ区切り
function addFigure(str){
return String(str).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment