Class Value

  • All Implemented Interfaces:
    ArrayFunction, Function, Function1Arg

    public final class Value
    extends Fixed1ArgFunction
    implements ArrayFunction
    Implementation for Excel VALUE() function.

    Syntax:
    VALUE(text)

    Converts the text argument to a number. Leading and/or trailing whitespace is ignored. Currency symbols and thousands separators are stripped out. Scientific notation is also supported. If the supplied text does not convert properly the result is #VALUE! error. Blank string converts to zero.

    • Constructor Detail

      • Value

        public Value()
    • Method Detail

      • evaluateArray

        public ValueEval evaluateArray​(ValueEval[] args,
                                       int srcRowIndex,
                                       int srcColumnIndex)
        Specified by:
        evaluateArray in interface ArrayFunction
        Parameters:
        args - the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
        srcRowIndex - row index of the cell containing the formula under evaluation
        srcColumnIndex - column index of the cell containing the formula under evaluation
        Returns:
        The evaluated result, possibly an ErrorEval, never null. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to Double.NaN be sure to translate the result to ErrorEval.NUM_ERROR.
      • convertTextToNumber

        public static java.lang.Double convertTextToNumber​(java.lang.String strText)
        TODO see if the same functionality is needed in OperandResolver.parseDouble(String)
        Returns:
        null if there is any problem converting the text
      • parseDateTime

        public static java.lang.Double parseDateTime​(java.lang.String pText)