Skip to content

Instantly share code, notes, and snippets.

@Zmoki
Created June 28, 2012 15:04
Show Gist options
  • Select an option

  • Save Zmoki/3011886 to your computer and use it in GitHub Desktop.

Select an option

Save Zmoki/3011886 to your computer and use it in GitHub Desktop.
Lead zero function
function leadZero(number, length) {
while(number.toString().length < length){
number = '0' + number;
}
return number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment