Last active
August 29, 2015 14:02
-
-
Save takunagai/571c4974974801011602 to your computer and use it in GitHub Desktop.
カンマを削除
This file contains 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
/** | |
* カンマを削除 | |
* | |
* @param {String or Number} 整形したいカンマ付き数字(=文字列)。小数点ありもOK。数値ならそのまま返す | |
* https://gist.github.com/oreo3/571c4974974801011602 | |
*/ | |
var removeComma = function(num) { | |
if (typeof num === 'string'){ | |
return (num.replace(/,/g, '')); | |
} | |
else { | |
return num; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment