Created
May 7, 2018 06:34
-
-
Save andreasvirkus/aa77d80b8d0de9e0c57bc97469253a68 to your computer and use it in GitHub Desktop.
Pad a number with leading zeros
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
export default (value) => { | |
return ('00' + value).slice(String(value).length); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment