I thought you said you wanted to keep your currency values to two
decimal places? BigDecimal will do this and it is sortable.
Randy Burgess
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chaudhary, Harsh
Sent: Monday, December 04, 2006 4:48 PM
To: displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Sorting in display tag
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
HC.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Burgess, Randy
Sent: Monday, December 04, 2006 3:46 PM
To: displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Sorting in display tag
Use java.math.BigDecimal.
Randy Burgess
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chaudhary, Harsh
Sent: Monday, December 04, 2006 11:33 AM
To: displaytag-user@lists.sourceforge.net
Subject: [displaytag-user] Sorting in display tag
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.
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.
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.
If not, how else can I do this?
I will be glad to provide any more specific info if needed.
Thanks,
HC.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user