commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [Beanutils] Problem with RowSetDynaClass when field have 3 decimal part.
Date Sat, 24 Jan 2004 08:33:13 GMT
hi

as i said, i strongly suspect that this is principally a JDBC 
driver/database issue. the solution i'd recommend is custom formatting 
in the presentation layer. in the custom tag, i'd suggest checking for 
values of type Float and then using a formatter than supresses the 
extra zeros.

- robert

On 22 Jan 2004, at 12:05, Anto Paul wrote:

> Hi,
>     I am using RowSetDynaClass to carry data to JSP. If the field is a
> number field and it have 3 digits after decimal it is printing 4 
> digits the
> last one being 0. For eg. instead of printing 1.256 it will print 
> 1.2560.
> Please suggest a way so that it won't affect other datatypes this is 
> because
> I am using a custom tag to print values in all pages.  I am doing this.
>
> ResultSet rs = pstmt.executeQuery();
> RowSetDynaClass rsdc = new RowSetDynaClass(rs);
> List   list = rsdc.getRows();
>
> In JSP
>
> DynaBean data = (DynaBean)list.get(0);
> out.print(data.get("weight"));
>
> Here 1.56 prints Ok while 1.562 prints as 1.5620.
>
> This is with JDK 1.4.1, Oracle 8.1.7. The field type is number(13,3).
>
> Hope this information is enough.
> rgds
> Antony Paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message