@Override public String text(IFormulaRenderer context) { ASTBaseNode nLeft = (ASTBaseNode) jjtGetChild(0); ASTBaseNode nRight = (ASTBaseNode) jjtGetChild(1); StringBuilder sb = new StringBuilder(); sb.append(nLeft.text(context)); sb.append(nRight.text(context)); return sb.toString(); }
@Override public IGenericValue eval(IFormulaContext context) { ASTBaseNode nLeft = (ASTBaseNode) jjtGetChild(0); ASTBaseNode nRight = (ASTBaseNode) jjtGetChild(1); IGenericValue gvValue = nLeft.eval(context); IGenericValue gvCount = nRight.eval(context); if (gvValue.getValueType() == GenericValueType.ERROR) { return gvValue; } Double val = gvValue.getNumberValue(); Double count = gvCount.getNumberValue(); if ((val == null) || (count == null)) { return new ErrorValue(ErrorValueType.VALUE); } return new NumberValue( Double.valueOf(val.doubleValue() * Math.pow(0.01d, count.doubleValue()))); }