开发者

sortable column with displaytag

My problem basically is that I want to display records in a table, for that use display tag, a field of the record 开发者_开发技巧corresponds to a numeric value, and I want to be shown in the following format: $ 4.258, for this I do next:

<fmt:setLocale value="en_US"/>
<display:column title="Monto" sortable="true" style="font-size: 12px;">
   $<fmt:formatNumber value="${datos.monto}" />
</display:column>

But this way the sortable is not working well, but if I put it this way:

<display:column title="Monto" property="monto" sortable="true" style="font-size: 12px;"/>

The sortable works well, but I have not in the format that I need, what it shows is: 4258.0.


You can specify the format as follows:

<display:column title="Monto" property="monto" format="$ {0,number,0,000.00}" sortable="true" style="font-size: 12px;"/>

You can use MessageFormat pattern.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜