我必须使用显示标签显示一列 Netsales,当我在 bean 标签中定义这个 netsales 并通过 scriptlet 获取值时,我得到了字符串类型的净销售额,因此我没有在我的显示表中对该列进行适当的排序。如何将其更改为数字类型?
<body>
<%String strCurrency=(String)session.getAttribute("strCurrency");%>
<fieldset><legend>Overall Outstanding</legend>
<bean:define id="NetSales"><bean:write name="NetSales" format="#,##,##0.00"/></bean:define>
<bean:define id="TotalBal"><bean:write name="TotalBal" format="#,##,##0.00"/></bean:define>
<display:table id="customerList" name="CustomerList" requestURI="" export="true" frame="true">
<display:caption style="font-weight:bold;text-align:left;padding-left:7px;line-height:25px;display:none;" >Overall Outstanding</display:caption>
<bean:define id="custno"><bean:write name="customerList" property="custNo" /></bean:define>
<bean:define id="netSales"><bean:write name="customerList" property="netSales" format="#,##,##0.00"/></bean:define>
<bean:define id="openBal"><bean:write name="customerList" property="openBal" format="#,##,##0.00"/></bean:define>
<display:column property="custName" title="Customer Name" sortable="true" class="l" headerClass="hl"/>
<display:column property="city" title="City" sortable="true" class="l" headerClass="hl"/>
<display:column title="Net Sales" media="html" sortable="true" class="r" headerClass="hr" sortName="NetSales"><%=netSales %></display:column>
<display:column property="netSales" media="xml csv pdf excel" format="{0,number, #,##,##0.00}" class="r" headerClass="hr" />
<display:column title="Total Balance" media="html" sortable="true" class="r" headerClass="hr"><%=strCurrency %><%=openBal %></display:column>
<display:column property="openBal" media="xml csv pdf excel" format="{0,number, #,##,##0.00}" class="r" headerClass="hr"/>
<display:footer media="html">
<tr>
<td colspan="3" align="right"> </td>
<td class="r"><%=strCurrency %><%=NetSales%></td>
<td class="r"><%=strCurrency %><%=TotalBal%></td>
</tr>
</display:footer>
</display:table>
</fieldset>
</body>