if(err!=null) return err.getString();
if(result instanceof String && !((String) result).isEmpty()){
- return FormulaError2.VALUE.getString();
+ Number num = SpreadsheetGraphUtils.asValidNumber(result);
+ if(num == null) {
+ return FormulaError2.VALUE.getString();
+ } else {
+ result = num;
+ }
}
else if(result instanceof Variant){
Object val = ((Variant)result).getValue();
if(err!=null) return err.getString();
if(result instanceof String && !((String) result).isEmpty()){
- return FormulaError2.VALUE.getString();
+ Number num = SpreadsheetGraphUtils.asValidNumber(result);
+ if(num == null) {
+ return FormulaError2.VALUE.getString();
+ } else {
+ result = num;
+ }
}
else if(result instanceof Variant){
Object val = ((Variant)result).getValue();