David, What I do in this case is override the setter and strip out all non-numeric stuff. Then I code a method called getFormattedXXX() which does the pretty formatting with commas, 2 significant digits, etc.
This way, you have control over which format you use at the different states in the application. For human viewable areas, use the getFormattedXXX() and for persisting in the database, just use the getXXX() Make sense? On Tue, Jul 8, 2008 at 10:59 AM, David Phipps < [EMAIL PROTECTED]> wrote: > Hi, > > I have some numeric (currency) input fields on a form and the client wants > them formatted like this 1,000.00. I am using DecimalFormat() on the form > value to display the correct format however when I submit this to reactor to > setCost() it doesn't like it because of the comma. > > Do I have to do a Replace() on each number formatted like this or is there > a better way? > > Cheers, > > Dave > _______________________________________________________________________ > David Phipps > Director, Chapel Studios > > T +44 (0)20 7100 6980 F +44 (0)20 7100 6981 M +44 (0)7765 240899 > New Broad Street House, 35 New Broad Street, London, EC2M 1NH, UK > > http://www.chapel-studios.co.uk > _______________________________________________________________________ > > The Chapel Studios group of companies are registered in England. 'Chapel > Studios' and the Chapel Studios logo are registered trademarks of Chapel > Studios. The information in this email is confidential, intended solely for > the addressee, and may be legally privileged. If you are not the addressee > or authorized to receive this for the addressee, you must not use, copy, > disclose or take any action based upon this message or any information > herein. If you have received this message in error, please advise the > sender immediately by reply e-mail. > > > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > -- -- > Reactor for ColdFusion Mailing List > [EMAIL PROTECTED] > Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > -- -- > > -- "Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew." Guillaume Apollinaire quotes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [EMAIL PROTECTED] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
