Javascript String padZeros( length )

Description

Javascript String padZeros( length )


String.prototype.padZeros = function ( length ) {
  length = length || 5;// w  ww. java  2  s.c o m
  var s = "000000000000000" + this;
  return s.substr(s.length-length);
};



PreviousNext

Related