I wouldn't recomend declaring it as float ou double. With floating point,
sometimes 14.8 minus 13.76 is 1.040000000000001.

Use BigDecimal. It is much safer.

-- Cristiano

On Wed, Feb 25, 2009 at 7:20 PM, Daniel Ferreira Castro
<[email protected]>wrote:

> I would like an opinion about what is the propper, or more recommended, way
> to format a TextField to show money?
> Should I declare it TextField<String> or TextField<Float>?
>
> And to format it with the money symbol ( Like US$) while you type?  Any
> ideas?
>
> --
> "Two rules to succeed in life:
> 1 - don“t tell people everything you know."
> --------
> We shall go on to the end.
> We shall fight in France
> We shall fightover the seas and oceans.
> We shall fight with growing confidence and growing strength in the air.
> We shall defend our island whatever the cost may be
> We shall fight on beaches, we shall fight on the landing grounds,
> We shall fight in the fields and in the streets,
> We shall fight on the hills.
> We shall never surrender.
> Winston Churchill
>

Reply via email to