public TypeValuePair evaluate(final FormulaContext context,
final TypeValuePair value1)
throws EvaluationException
{
final Type type = value1.getType();
final Object val = value1.getValue();
if (val == null)
{
throw new EvaluationException(LibFormulaErrorValue.ERROR_NA_VALUE);
}
if (type.isFlagSet(Type.NUMERIC_TYPE))
{
final TypeRegistry typeRegistry = context.getTypeRegistry();
// return the same as zero minus value.
final Number number = typeRegistry.convertToNumber(type, val);
final BigDecimal value = getAsBigDecimal(number);