Jun 06
Quick Tip: Formatting Number Columns with DisplayTag
Displaytag supports easy display of formatted number columns using the format attribute on <display:column> - however, it’s not really well documented on the Displaytag site. Here’s how to do simple number formatting without requiring a decorator class:
<displaytag:column property="amount" title="$ Amount" format="{0,number,#.##}"/>This will display a decimal formatted to a maximum of 2 decimal places!


August 18th, 2008 at 7:23 am
Do you know where can I find all the formatting rules?
Thanks
August 18th, 2008 at 7:53 am
Well, this syntax is actually instantiating a MessageFormatColumnDecorator behind the scenes. That Decorator simply hands off the contents of the column to an instance of MessageFormat with the specified pattern. So, the answer to your question is - “look at the MessageFormat Javadoc”. Hope that helps!
August 19th, 2008 at 1:06 am
It helped indeed!!
Thank you