Created
September 11, 2012 08:17
-
-
Save batako/3696854 to your computer and use it in GitHub Desktop.
3桁カンマ区切り
This file contains hidden or 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
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