Created
May 29, 2015 11:54
-
-
Save yyfrankyy/8316450fdeb5d58d2013 to your computer and use it in GitHub Desktop.
padding function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pad(n, m) { | |
return String(Array(n+1).join('0')+m).slice(-n); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment