Created
April 30, 2013 08:04
-
-
Save srod/5487282 to your computer and use it in GitHub Desktop.
/** * Add extra zeros in front of a number * @param str {String} * @param max {Number} * @returns {*} */
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
/** | |
* Add extra zeros in front of a number | |
* @param str {String} | |
* @param max {Number} | |
* @returns {*} | |
*/ | |
var pad = function(str, max) { | |
return str.toString().length < max ? pm.utils.pad('0' + str, max) : str; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment