2009-07-27から1日間の記事一覧
JavaScript です。 Number.prototype.toStringSeparatedByCommas = // 以下140字 function(){for(var n=this,a=""+~~n,b=(""+n).substr(a.length),e=RegExp("(\\d)(\\d{3})(,|$)");e.test(a);a=a.replace(e,"$1,$2$3"));return a+b}; 問題点 整数にするのに…
JavaScript です。 Number.prototype.toStringSeparatedByCommas = // 以下140字 function(){for(var n=this,a=""+~~n,b=(""+n).substr(a.length),e=RegExp("(\\d)(\\d{3})(,|$)");e.test(a);a=a.replace(e,"$1,$2$3"));return a+b}; 問題点 整数にするのに…