db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fabio_patricio" <fabio_patri...@terra.com.br>
Subject Re: Problem with decimal precision
Date Fri, 04 Mar 2005 14:41:09 GMT
Tks,

  I decided my problem using BigDecimal formatted with two decimal
houses.  
  But it is good for knowing that bug was one and already it meets solved.

  Ps.: We are using the Derby in a great project here in Brazil, will
be a good one case of success.  I am seeing the possibility to
liberate an article on the same.

  Beste Regards

  Fabio Patricio

---------- Cabeçalho inicial  -----------

De: "Daniel John Debrunner" djd@debrunners.com
Para: "Derby Discussion" derby-user@db.apache.org
Cópia: 
Data: Fri, 04 Mar 2005 06:28:15 -0800
Assunto: Re: Problem with decimal precision

> fabio_patricio wrote:
> >   Hi,
> > 
> >   I have a field decimal(10,2) where I insert "32,78", but when I go
> > to look at in the table the inserted value was "32,77", alguem which
> > the problem?
> > 
> 
> This is a bug Derby-123 and is fixed in the development trunk.
> 
> http://issues.apache.org/jira/browse/DERBY-123
> 
> Though as Jeff said, using doubles and DECIMAL may lead to unexpected
> results due to mixing of imprecise and precise values.
> 
> 
> >   My code:
> 
> >             pstmt.setDouble(1, new Double("32.78").doubleValue());
> 
> You can also use setString() on most types in Derby, thus the above line
> could have been
> 
> pstmt.setString(1, "32.78");
> 
> That will insert the correct value in Derby's current release 10.0.2.1
> 
> Dan.
> 
> 
> 


Mime
View raw message