code: function pad(val, len) {
          val = val.toString();
          var padded = [];
  
          for (var i = 0, j = Math.max(len - val.length, 0); i < j; i++) {
              padded.push('0');
          }
  
          padded.push(val);
          return padded.join('');
      }
docs: /* takes a value, converts to string if need be, then pads it
  to a minimum length.