text: public static double coerceValueToDouble(ValueEval ev) throws EvaluationException {if (ev == BlankEval.instance) {return 0.0;}if (ev instanceof NumericValueEval) {return ((NumericValueEval)ev).getNumberValue();}if (ev instanceof StringEval) {String sval = ((StringEval) ev).getStringValue();Double dd = parseDouble(sval);if(dd == null) dd = parseDateTime(sval);if (dd == null) {throw EvaluationException.invalidValue();}return dd.doubleValue();}throw new RuntimeException("Unexpected arg eval type (" + ev.getClass().getName() + ")");}