function (number, digits) {
    if (typeof number !== "number") { throw "not a number: " + number; }
    var s = number.toString();
    if (number.length > digits) {
      return number.substr(number.length - digits, number.length);
    }
    while (s.length < digits) {
      s = '0' + s;
    }
    return s;
  }
function (number, digits) {
    if (typeof number !== "number") { throw "not a number: " + number; }
    var s = number.toString();
    if (number.length > digits) {
      return number.substr(number.length - digits, number.length);
    }
    while (s.length < digits) {
      s = '0' + s;
    }
    return s;
  }
function ( number , digits ) { if ( typeof number !== "number" ) { throw "not a number: " + number ; } var s = number . toString ( ) ; if ( number . length > digits ) { return number . substr ( number . length - digits , number . length ) ; } while ( s . length < digits ) { s = '0' + s ; } return s ; }
Format a number to the length = digits. For ex:  `_fixWidth(2, 2) = '02'`  `_fixWidth(1998, 2) = '98'`  This is used to pad numbers in converting date to string in ISO standard.
Format a number to the length = digits . For ex : _fixWidth ( 2 2 ) = 02 _fixWidth ( 1998 2 ) = 98 This is used to pad numbers in converting date to string in ISO standard .
Returns a number with the given number of digits