Examples of convertToNumber()


Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

        if (rawValue == null)
        {
          throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
        }
        final TypeValuePair nextValue = rawValue.evaluate();
        final Number number = typeRegistry.convertToNumber(nextValue.getType(), nextValue.getValue());
        final BigDecimal next = NumberUtil.getAsBigDecimal(number);
        if (last == null)
        {
          last = next;
        }
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    }
    int indexFrom = 0;

    if (indexType != null)
    {
      final Number n = typeRegistry.convertToNumber(indexType, indexValue);
      if (n.intValue() >= 1)
      {
        indexFrom = n.intValue() - 1;
      }
      else
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2), parameters.getValue(2));

    if (n1 == null || n2 == null || n3 == null)
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2), parameters.getValue(2));

    if (n1 == null || n2 == null || n3 == null)
    {
      throw EvaluationException.getInstance(
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Number n1 = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));
    final Number n2 = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
    final Number n3 = typeRegistry.convertToNumber(parameters.getType(2), parameters.getValue(2));

    if (n1 == null || n2 == null || n3 == null)
    {
      throw EvaluationException.getInstance(
          LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

      {
        // ignore
      }
      try
      {
        final Number date = typeRegistry.convertToNumber(type2, value2);
        final NumberFormat dateFormat = new DecimalFormat
            (formatString, new DecimalFormatSymbols(locale));
        return new TypeValuePair(TextType.TYPE, dateFormat.format(date));
      }
      catch (EvaluationException ev)
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    // This fixes the common rounding errors, that are encountered when computing "((1/3) * 3)", which results
    // in 0.99999 and not 1, as expected.
    try
    {
      final Number number1 = typeRegistry.convertToNumber(textType1, textValue1);
      final Number number2 = typeRegistry.convertToNumber(textType2, textValue2);

      final double delta = Math.abs(Math.abs(number1.doubleValue()) - Math.abs(number2.doubleValue()));
      if(delta < 0.00005)
      {
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    // This fixes the common rounding errors, that are encountered when computing "((1/3) * 3)", which results
    // in 0.99999 and not 1, as expected.
    try
    {
      final Number number1 = typeRegistry.convertToNumber(textType1, textValue1);
      final Number number2 = typeRegistry.convertToNumber(textType2, textValue2);

      final double delta = Math.abs(Math.abs(number1.doubleValue()) - Math.abs(number2.doubleValue()));
      if(delta < 0.00005)
      {
        return RETURN_TRUE;
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Number n2;
    final Number n3;
    try
    {
      final TypeRegistry typeRegistry = context.getTypeRegistry();
      n1 = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));
      n2 = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
      n3 = typeRegistry.convertToNumber(parameters.getType(2), parameters.getValue(2));
    } catch (NumberFormatException e)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToNumber()

    final Number n3;
    try
    {
      final TypeRegistry typeRegistry = context.getTypeRegistry();
      n1 = typeRegistry.convertToNumber(parameters.getType(0), parameters.getValue(0));
      n2 = typeRegistry.convertToNumber(parameters.getType(1), parameters.getValue(1));
      n3 = typeRegistry.convertToNumber(parameters.getType(2), parameters.getValue(2));
    } catch (NumberFormatException e)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.