Skip to content

Instantly share code, notes, and snippets.

@srod
Created April 30, 2013 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srod/5487282 to your computer and use it in GitHub Desktop.
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 {*} */
/**
* 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