Hello Friends, I have a java function, where I have a String - which has numbers stored as string.
When I "return" the string as a String, it prints perfectly fine. But I need to do some math-data manipulation with those string numbers. When I try to convert the string into int (int a = Integer.parseInt(myString);), it gives me following error in log file --------------------------------------------------------------------------- BSH Evaluation error. Exception: bsh.TargetError Message: Sourced file: inline evaluation of: ``com.opensourcestrategies.financials.reports.ReportHelper.getOrderSubTotal(delega . . . '' : Method Invocation com.opensourcestrategies.financials.reports.ReportHelper.getOrderSubTotal ---- stack trace --------------------------------------------------------------- Sourced file: inline evaluation of: ``com.opensourcestrategies.financials.reports.ReportHelper.getOrderSubTotal(delega . . . '' : Method Invocation com.opensourcestrategies.financials.reports.ReportHelper.getOrderSubTotal : at Line: 1 : in file: inline evaluation of: ``com.opensourcestrategies.financials.reports.ReportHelper.getOrderSubTotal(delega . . . '' : com .opensourcestrategies .financials .reports .ReportHelper .getOrderSubTotal ( delegator , OTCMOrderNo ) Target exception: java.lang.IndexOutOfBoundsException: index: 0 for list of size: 0 bsh.BSHMethodInvocation.eval(Unknown Source) bsh.BSHPrimaryExpression.eval(Unknown Source) bsh.BSHPrimaryExpression.eval(Unknown Source) bsh.Interpreter.evalParsedScript(Unknown Source) bsh.Interpreter.eval(Unknown Source) bsh.Interpreter.eval(Unknown Source) bsh.Interpreter.eval(Unknown Source) org.ofbiz.base.util.BshUtil.eval(BshUtil.java:77) --------------------------------------------------------------------------- I was not able to understand the error. I really appreciate the help. Thank you in advance. su- -- View this message in context: http://www.nabble.com/Error-while-converting-string-to-int-tp25686534p25686534.html Sent from the OFBiz - User mailing list archive at Nabble.com.
