Created
February 5, 2014 12:01
-
-
Save chefe/8822271 to your computer and use it in GitHub Desktop.
Format a integer value with a leading zero if it is smaller than 10
This file contains 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
/** | |
* Format a integer with a leading zero if the values is smaller then 10 | |
* @param int inputInt a integer value | |
*/ | |
function leadingZeroInt(inputInt) { | |
return (inputInt < 10 ? '0' + inputInt : '' + inputInt) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment