Skip to content

Instantly share code, notes, and snippets.

@chefe
Created February 5, 2014 12:01
Show Gist options
  • Save chefe/8822271 to your computer and use it in GitHub Desktop.
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
/**
* 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