code: function roundInt(str, precision = +Infinity) {
    if (!isNumStr(str, 10)) throw new Error('in roundInt, string must be an integer in base 10.');
    if (precision <= 0) throw new Error('in roundInt, precision must be greater than 0.');
    const minus = String.fromCharCode(consts.minus);
    
    str = rectify(str);
  
    // If the number is negative, ignore the negative sign for now.
    let start = (str[0] == minus) ? 1 : 0;
  
    // If the length of the number is less than or equal to precision, return the number.
    if (str.length - start <= precision) return str;
  
    // Get the significant part, the digit following, and the remaining digits.
    let sigPart = str.slice(start, precision + start);
    let nextDigit = charToVal(str[precision + start]);
    let remainder = str.slice(precision + start + 1);
  
    // Decide whether to increment the significant part; round half to even.
    let increment = false;
    if (nextDigit > 5) increment = true;
    else if (nextDigit == 5) {
      if (!isEntirely(remainder, consts.alphabet[0])) increment = true;  // inc if remainder is nonzero
      else {
        let lSigDigit = charToVal(sigPart[precision - 1]); // otherwise inc if it will give you an even number.
        if (lSigDigit % 2) increment = true;
      }
    }
    if (increment) sigPart = incInt(sigPart);
  
    // The rounded value is the significant part padded with zeros.
    let roundedLength = sigPart.length + 1 + remainder.length;
    let rounded = sigPart.padEnd(roundedLength, consts.alphabet[0]);
  
    // If the value was negative, replace the negative sign.
    rounded = (str[0] == minus) ? minus + rounded : rounded;
  
    return rounded;
  }
docs: /* Round a base 10 integer string to a given number of significant digits.
  *
  * @param {string} str - The integer to be rounded.
  * @param {number} precision - The desired number of significant digits.
  * @return {string} The rounded integer.