How to apply multiple lines in JPython Node

I would like to apply a somewhat more complex calculation in a python node like this:

value = int(float(val("Weka Regression"))/10.0+0.5)*10

if value<500: value=500

if value>600: value=600

return str(value)

But this seems not to work. Unfortunately there is no comment on the error at the console output.

By the way: the round(x,n) function produces also an error -> why?

Yes, that doesn't work. The script is directly embedded into a function call (PythonFunctionNodeModel.java, line 60++):

        header.append("    newCell = getDataCell(");
        scriptHeader = header.toString();
        StringBuffer footer = new StringBuffer();
        footer.append(")\n");


(In the first line it has an opening parenthesis, then comes your code, then it closes the method call in the last line.)

You need to use something different, e.g. the java snippet or perl nodes. You could also use the other python nodes.