Skip to content

Instantly share code, notes, and snippets.

@takunagai
Last active August 29, 2015 14:02
Show Gist options
  • Save takunagai/571c4974974801011602 to your computer and use it in GitHub Desktop.
Save takunagai/571c4974974801011602 to your computer and use it in GitHub Desktop.
カンマを削除
/**
* カンマを削除
*
* @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