public final class Value extends Fixed1ArgFunction implements ArrayFunction
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 and Description |
---|
Value() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Double |
convertTextToNumber(java.lang.String strText)
TODO see if the same functionality is needed in
OperandResolver.parseDouble(String) |
ValueEval |
evaluate(int srcRowIndex,
int srcColumnIndex,
ValueEval arg0)
|
ValueEval |
evaluateArray(ValueEval[] args,
int srcRowIndex,
int srcColumnIndex) |
static java.lang.Double |
parseDateTime(java.lang.String pText) |
evaluate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_evaluateOneArrayArg, _evaluateTwoArrayArgs, evaluateOneArrayArg, evaluateTwoArrayArgs
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0)
Function1Arg
evaluate
in interface Function1Arg
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
evaluateArray
in interface ArrayFunction
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 evaluationsrcColumnIndex
- column index of the cell containing the formula under evaluationErrorEval
, 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
.public static java.lang.Double convertTextToNumber(java.lang.String strText)
OperandResolver.parseDouble(String)
null
if there is any problem converting the textpublic static java.lang.Double parseDateTime(java.lang.String pText)
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.