Top Description Fields Constructors Methods
org.apache.poi.ss.formula.functions

public final Class Value

extends Fixed1ArgFunction
implements ArrayFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.ArrayFunction
Imports
org.apache.poi.ss.formula.eval.BlankEval, .ErrorEval, .EvaluationException, .NumberEval, .OperandResolver, .ValueEval, org.apache.poi.ss.usermodel.DateUtil, org.apache.poi.util.StringUtil, java.time.DateTimeException

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.

Field Summary

Modifier and TypeField and Description
private static final int
MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATOR

"1,0000" is valid, "1,00" is not

private static final Double

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Double

Returns:

null if there is any problem converting the text
convertTextToNumber
(String strText)

TODO see if the same functionality is needed in OperandResolver#parseDouble(String)

public ValueEval
public ValueEval
evaluateArray(ValueEval[]
the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
args
,
int
row index of the cell containing the formula under evaluation
srcRowIndex
,
int
column index of the cell containing the formula under evaluation
srcColumnIndex
)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

public static Double
Inherited from org.apache.poi.ss.formula.functions.Fixed1ArgFunction:
evaluate

Field Detail

MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATORback to summary
private static final int MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATOR

"1,0000" is valid, "1,00" is not

ZEROback to summary
private static final Double ZERO

Constructor Detail

Valueback to summary
public Value()

Method Detail

convertTextToNumberback to summary
public static Double convertTextToNumber(String strText)

TODO see if the same functionality is needed in OperandResolver#parseDouble(String)

Returns:Double

null if there is any problem converting the text

evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0)

Implements org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

evaluateArrayback to summary
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.

srcRowIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

row index of the cell containing the formula under evaluation

srcColumnIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

column index of the cell containing the formula under evaluation

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

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.

Annotations
@Override
parseDateTimeback to summary
public static Double parseDateTime(String pText)