Actually, I can't get it to work. This is what I'm trying to do.
Number.prototype.commaFormat = function() {
n = this.toString(); insPTR = 1;
if (n.indexOf("."

== -1 ){
t = ""; n = n.split(""

;
}else{
t = n.substr(n.indexOf("."

, n.length);
n = n.substr(0, n.indexOf("."

).split(""

;
}
for (ptr in n) {
t = n[ptr]+t;
if (insPTR++ == 3) {
insPTR = 1;
t = (isNaN(n[0]) && ptr > 1) || (!isNaN(n[0]) && ptr >= 1) ? ","+t : t;
}
}
return t;
};
mynum = "123456789,34234,23423423,24523423,25234523";
var list_temp = mynum.split(","

;
for (i=0; i < list_temp.length; i++){
tmpvar = list_temp
;
trace(tmpvar.commaFormat());
}
The trace returns "undefined". Is there something wrong with my code?