Created
September 12, 2011 21:46
-
-
Save doctyper/1212559 to your computer and use it in GitHub Desktop.
Add a leading zero to a single-digit number
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
// 12 => 12 | |
// 1 => 01 | |
number = ("0" + number).slice(-2); |
potench
commented
Sep 12, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment