Ensures a number is padded with a certain amount of leading characters
@param {number} number
@param {number} minLength
@param {string} padWith
358683
function leadingZeros(number, minLength = 0, padWith = '0') {
  const stringNumber = number.toString()
  const paddingLength = minLength - stringNumber.length
  return paddingLength > 0 ? `${padWith.repeat(paddingLength)}${stringNumber}` : stringNumber
}
979477
function(str, pad) {
			var padding = '';
			var il = str.length;
				
			while (pad > il++) padding += '0';
			return padding + str; 
		}
441327
function pad (content, length) {
    content = content || ''

    while (content.length < length) {
      content = content + ' '
    }

    return content
  }
1041339
function pad(num, size) {
	var s = num+"";
	while (s.length < size) {
		s = "0" + s;
	}
	return s;
}
438872
function leftPad(n, prefix, maxN) {
  const s = n.toString();
  const nchars = Math.max(2, String(maxN).length) + 1;
  const nspaces = nchars - s.length - 1;

  return prefix + ' '.repeat(nspaces) + s;
}
1075639
function padNumbersToEqualLength(arr) {
  var maxLen = 0;
  var strings = arr.map(function(n) {
    var str = n.toString();
    maxLen = Math.max(maxLen, str.length);
    return str;
  });
  return strings.map(function(s) { return common.padLeft(s, maxLen); });
}
79751
function pad(obj, width)
{
	var objstr, rv, i;

	if (obj === undefined)
		objstr = '';
	else
		objstr = obj.toString();

	rv = '';

	if (typeof (obj) != 'number')
		rv += objstr;

	for (i = objstr.length; i < width; i++)
		rv += ' ';

	if (typeof (obj) == 'number')
		rv += objstr;

	return (rv);
}
1185112
function readNumericString(s, minValue) {
    var length = readLength(s);
    length = (length + minValue + 1) / 2;
    s.readPadding(length);
}
702397
function pad(text, width) {
  var space = (width - text.length) + 5;
  return text + Array(space).join(" ");
}
351429
def _pad(string, size):
    
    strlen = len(string)
    if strlen == size:
        return string
    if strlen < size:
        return _padding[0:size-strlen] + string
    return string[-size:]
688007
function padded_string(str)
{
   if (str.length == 0)
       return '';
 
   var pad = padded_length(str.length) - str.length;
   var res = str;
   for (var i=0; i < pad; ++i)
       res += String.fromCharCode(0);

   return res;
}
861324
function getPadding(str, width) {
  const spaceLen = (typeof width === 'undefined' ? 30 : width) - str.length;
  let padding = '';

  padding += '  ';
  for (let i = 2; i < spaceLen; i += 1) {
    padding += '-';
  }
  padding += '  ';
  return padding;
}
631395
function _rsapem_encodeLength(length) {
    if (length >= parseInt("80", 16)) {
        var realLength = _rsapem_padWithZero(length.toString(16));
        var lengthOfLength = (realLength.length / 2);
        return (parseInt("80", 16) + lengthOfLength).toString(16) + realLength;
    } else {
        return _rsapem_padWithZero(length.toString(16));
    }
}
1228683
function(strings) {
			var lengths = strings.map(function(s) {
				return typeof s === 'string' ? s.length : +s;
			});
			
			var max = lengths.reduce(function(prev, cur) {
				return typeof prev === 'undefined' ? cur : Math.max(prev, cur);
			});
			return lengths.map(function(l) {
				var pad = max - l;
				return pad ? this.repeatString(' ', pad) : '';
			}, this);
		}
11030
protected NumberRule selectNumberRule(final int field, final int padding) {
		switch (padding) {
			case 1:
				return new UnpaddedNumberField(field);
			case 2:
				return new TwoDigitNumberField(field);
			default:
				return new PaddedNumberField(field, padding);
		}
	}
1144653
function stringPadStart (str, targetLength, padString, UNDEFINED) {
  var rest = '' + str
  targetLength = targetLength >> 0
  padString = padString === UNDEFINED ? ' ' : '' + padString
  if (rest.padStart) {
    return rest.padStart(targetLength, padString)
  }
  if (targetLength > rest.length) {
    targetLength -= rest.length
    if (targetLength > padString.length) {
      padString += stringRepeat(padString, targetLength / padString.length)
    }
    return padString.slice(0, targetLength) + rest
  }
  return rest
}
239679
public void setPattern(NumberPattern pattern, int _maxSigDigits, int _minSigDigits) {
    Format format = pattern.format();
    minIntDigits = orDefault(options.minimumIntegerDigits(), format.minimumIntegerDigits());

    maxFracDigits = currencyDigits == -1 ? format.maximumFractionDigits() : currencyDigits;
    maxFracDigits = orDefault(options.maximumFractionDigits(), maxFracDigits);

    minFracDigits = currencyDigits == -1 ? format.minimumFractionDigits() : currencyDigits;
    minFracDigits = orDefault(options.minimumFractionDigits(), minFracDigits);

    boolean useSignificant = formatMode == SIGNIFICANT || formatMode == SIGNIFICANT_MAXFRAC;
    if (useSignificant) {
        maxSigDigits = orDefault(options.maximumSignificantDigits(), _maxSigDigits);
        minSigDigits = orDefault(options.minimumSignificantDigits(), _minSigDigits);
    } else {
        maxSigDigits = -1;
        minSigDigits = -1;
    }
  }