X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.graph%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fgraph%2FCellValueVisitor.java;h=8150b4dbadba87104e927a965c1e963970ea2fd0;hb=922dcf7ab2d716a6d17e6224bc1a12b1196233aa;hp=652659ce0349e1b87a4fc2f472d4d7d6efd0eab0;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/CellValueVisitor.java b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/CellValueVisitor.java index 652659ce0..8150b4dba 100644 --- a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/CellValueVisitor.java +++ b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/CellValueVisitor.java @@ -247,7 +247,12 @@ public class CellValueVisitor implements AstValueVisitor { 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(); @@ -280,7 +285,12 @@ public class CellValueVisitor implements AstValueVisitor { 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();