final int parameterCount = parameters.getParameterCount();
if (parameterCount < 1)
{
throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
}
final Type type1 = parameters.getType(0);
final Object value1 = parameters.getValue(0);
final TypeRegistry typeRegistry = context.getTypeRegistry();
if (parameterCount == 1)
{
final String result = typeRegistry.convertToText(type1, value1);
if(result == null)
{
throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
}
return new TypeValuePair(TextType.TYPE, result);
}
try
{
final Type type2 = parameters.getType(1);
final Object value2 = parameters.getValue(1);
final String formatString = typeRegistry.convertToText(type2, value2);
final Locale locale = context.getLocalizationContext().getLocale();
if (value1 instanceof Date)
{