by Dave Miller <dave@[EMAIL PROTECTED]
>
May 9, 2008 at 09:04 PM
zamba wrote:
> Hi....i have this value in a resultset called ConceptsDataRes:
>
> BASE_CALCULO=0.0001 and i wish to convert to string , so i use
>
> String CantFormat ="###,##0.0#";
> java.text.DecimalFormat dCantFormat = new
> java.text.DecimalFormat(CantFormat);
> dCantFormat.format(ConceptsDataRes.getDouble("BASE_CALCULO"));
>
> but it shows me 0.0 ....whats the problem ?
>
> also in the ame resultset i have the value
>
> MONTO=299.00 and i wish to convert to string so i use
>
> String CantFormat ="###,##0.00";
> java.text.DecimalFormat dCantFormat = new
> java.text.DecimalFormat(CantFormat);
> dCantFormat.format(ConceptsDataRes.getDouble("MONTO"));
>
> but it shows me 299.0 ....whats the problem ?
>
> tks friends !!!
>
>
>
>
Check the pattern on the first example - "###,##0.0000" should work.
The pattern is right in the second example - check whether the value
returned from the db is 299.0 or 299.00
--
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/