You need to create an object of class CurrencyUtil .
CurrencyUtil CU = new CurrencyUtil();
I suggest the currenyUtil method should be static and it takes three parameters.
public class CurrencyUtil { public static BigDecimal currencyUtil( RenderRequest renderRequest, RenderResponse renderResponse, String amountStr) throws IOException, PortletException { BigDecimal amount = new BigDecimal(amountStr); ... } }
and you can call him
BigDecimal value=CurrencyUtil.currencyUtil(request,response,billAmount);
source share