Here you can find the source of deleteComma()
String.prototype.deleteComma = function () { var string = this; while (string != (string = string.replace(/^(-?\d+)(\d{3})/, "$1,$2"))); return string; }