function compute(replacement, conversion) {
    var formatFunction;

    switch (conversion.typeSpecifier) {
      case TYPE_STRING:
        formatFunction = stringFormat;
        break;

      case TYPE_INTEGER_DECIMAL:
      case TYPE_INTEGER:
        formatFunction = integerDecimal;
        break;

      case TYPE_INTEGER_ASCII_CHARACTER:
      case TYPE_INTEGER_BINARY:
      case TYPE_INTEGER_OCTAL:
      case TYPE_INTEGER_HEXADECIMAL:
      case TYPE_INTEGER_HEXADECIMAL_UPPERCASE:
      case TYPE_INTEGER_UNSIGNED_DECIMAL:
        formatFunction = integerBase;
        break;

      case TYPE_FLOAT:
      case TYPE_FLOAT_SCIENTIFIC:
      case TYPE_FLOAT_SCIENTIFIC_UPPERCASE:
      case TYPE_FLOAT_SHORT:
      case TYPE_FLOAT_SHORT_UPPERCASE:
        formatFunction = float;
        break;
    }

    var formattedString = formatFunction(replacement, conversion);
    return alignAndPad(formattedString, conversion);
  }
Returns the computed string based on format specifiers.

@ignore
@name computeReplacement
@param {string} replacement The replacement value.
@param {ConversionSpecification} conversion The conversion specification object.
@return {string} Returns the computed string.