Here you can find the source of padLeft(max, c)
/*//from w ww .j a v a 2s . c om @max {Number} @c {String} :: optional return {String} */ Number.prototype.padLeft = function(max, c) { return this.toString().padLeft(max, c || '0'); };
Number.prototype.pad = function (size, decimalSize, decimalChar) { if (!decimalChar) decimalChar = '.'; var str = this.toString(); str = str.split("."); var result = str[0].pad("0", size ? size : 0); if (str.length==2){ result += decimalChar + str[1].pad("0", decimalSize, true); return result; ...
Number.prototype.padLeft = function (base, chr) { var len = (String(base || 10).length - String(this).length) + 1; return len > 0 ? new Array(len).join(chr || '0') + this : this; function formatDate(d) { return [(d.getFullYear()).padLeft(), (d.getMonth() + 1).padLeft(), d.getDate().padLeft()].join('-') + ' ' + ...
Number.prototype.padLeft = function (base, chr) { var len = (String(base || 10).length - String(this).length) + 1; return len > 0 ? new Array (len).join(chr || '0') + this : this; }; Array.prototype.compare = function (array) { if (!array) return false; if (this.length != array.length) return false; ...
Number.prototype.padLeft = function (base, chr) { var len = (String(base || 10).length - String(this).length) + 1; return len > 0 ? new Array(len).join(chr || '0') + this : this; };
Number.prototype.padLeft = function(base,chr) { var len = (String(base || 10).length - String(this).length)+1; return len > 0? new Array(len).join(chr || '0')+this : this; };
Number.prototype.padLeft = function(n, str) { return Array(n-String(this).length+1).join(str||'0')+this; };
Number.prototype.padRight = function(max, c) { return this.toString().padRight(max, c || '0'); };
Number.prototype.padWithDigits = function (n) { var txt = this.toString(); while(txt.length < n) { txt = '0' + txt; return txt; };
Number.prototype.padZeros = function(n){ return this.toString().padZeros(n); };