hi
i want ot use NumberFormat on a filed i am using like this but getting error
<% NumberFormat formatter = new DecimalFormat("#.##"); %>
<rich:scrollableDataTable height="150px" width="500px" sortMode="false" value="#{mainBind.customWizard.clstrDtl.deviceList}" var="device"> <rich:column id="freespace" sortable="false"> <f:facet name="header"> <h:outputLabel styleClass="headerText" value="Free Space" /> </f:facet> <h:outputText value="#{formatter.format(device.freeSpace/1073741824)} GB" /> </rich:column>
Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: /pages/wizards/ClusterWizard.jsp(197,6) The function format must be used with a prefix when a default namespace is not specified
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
at org.apache.jsp.pages.Wizard_jsp._jspService(Wizard_jsp.java:113)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
... 54 more
You cannot call functions from EL expressions. Store formatted value in variable and output it; or better use h:outputFormat.