Skip to content

Instantly share code, notes, and snippets.

@wynnzen
Created December 12, 2016 11:39
Show Gist options
  • Save wynnzen/686111623a5921fe25a39118345d393f to your computer and use it in GitHub Desktop.
Save wynnzen/686111623a5921fe25a39118345d393f to your computer and use it in GitHub Desktop.
add zero before str
function addZero(str,length){
return new Array(length - str.length + 1).join("0") + str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment