Re: [displaytag-user] Sorting in display tag
Brought to you by:
fgiust
From: Chaudhary, H. <HCH...@am...> - 2006-12-04 21:48:11
|
Actually, I have resolved this issue using sortProperty. But just out of curiosity, how will BigDecimal help? As far as I remember, it has fields for rounding which do not help me in cases like 2.0 --> 2.00 or 2.1 --> 2.10 =20 HC. =20 -----Original Message----- From: dis...@li... [mailto:dis...@li...] On Behalf Of Burgess, Randy Sent: Monday, December 04, 2006 3:46 PM To: dis...@li... Subject: Re: [displaytag-user] Sorting in display tag Use java.math.BigDecimal. =20 Randy Burgess =20 _____ =20 From: dis...@li... [mailto:dis...@li...] On Behalf Of Chaudhary, Harsh Sent: Monday, December 04, 2006 11:33 AM To: dis...@li... Subject: [displaytag-user] Sorting in display tag =20 Hi all, I need to display a table which has columns of strings, dates and doubles. These need to be sortable. And that's my problem. =20 For example, the currency column has double values and our DB is such that these nos could be stuff like 0.25, 9.2, 12355.210E10. But the nos need to be formatted as 0.25, 9.20, 12355.22. =20 I implemented a decorator using DecimalFormat object. The problem is that it returns a string. My question is how to set the no. of decimal places of a double or Double object to 2 decimal places. I realize this is not a displaytag question but other people here have got to have come across this. =20 If not, how else can I do this? =20 I will be glad to provide any more specific info if needed. =20 Thanks, HC. |