code: private String arith(){
  
          if(params.length != 3){
              throw new IllegalArgumentException("Wrong number of Parameters for arithmetic expression");
          }
  
          double res = 0;
          try{
              String operator = params[2];
  
              double firstValue = Double.parseDouble(record.getValueByFieldName(params[0]));
  
              double secondValue = Double.parseDouble(record.getValueByFieldName(params[1]));
  
  
              if("+".equals(operator)){
                  res = firstValue + secondValue;
              }else if("-".equals(operator)){
                  res = firstValue - secondValue;
              }else if("*".equals(operator)){
                  res = firstValue * secondValue;
              }else if("/".equals(operator)){
                  res = firstValue / secondValue;
              }else if("%".equals(operator)){
                  res = (firstValue / secondValue) * 100;
              }
  
              NumberFormat decimalFormat = NumberFormat.getFormat(".##");
              res = Double.parseDouble(decimalFormat.format(res));
          }catch(Exception e){
              System.err.println("Error calculating table arithmetic function");
          }
          return Double.toString(res);
  
      }
docs: Calculate an arithmetic expression
  In the config file use:
  fieldName="func(ARITH(field1,field2,operator))"