Thanks Kathir

So which class do you use to format the float into a String representation like 
"$#,##0.00" ?

Kind regards
mc

On 9 Sep 2005 at 12:50, Murugesan, Kathiresan (Cognizant) wrote:

> Its always better to use Float object while handling price related fields...
>  
> Regards
> Kathir.
> 
> ________________________________
> 
> From: Murray Collingwood [mailto:[EMAIL PROTECTED]
> Sent: Fri 9/9/2005 12:44 PM
> To: user@struts.apache.org
> Subject: A nice easy question
> 
> 
> 
> Hi all
> 
> I put a price field (float) in a form (textbox) but had some trouble parsing 
> the text 
using
> the DemicalFormat class (it doesn't seem to like the 'float' type).  So I 
> went through
> changing my field to 'int' but now of course I can only store whole dollar 
> amounts.
> 
> To save me lots of time, should I:
> 
> a) use long
> b) use double
> c) go back to float and fix my parsing
> d) use int and store the value as cents (rather than dollars) (n*100 and 
> n/100)
> 
> Kind regards
> mc
> 
> 
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to