ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shilpa <shilpa.prad...@judiciary.state.nj.us>
Subject Re: QueryForObject returns wrong data
Date Wed, 27 Jul 2005 17:19:25 GMT
Daniel Henrique Ferreira e Silva <dhsilva <at> gmail.com> writes:

> 
> Shilpa,
> 
> That is exactly the point Larry tried to show you. As your BigDecimal
> has scale 0, it shows you only the integer part of the value. Set it
> to 2, for example, in your setter:
> 
> public void setMyBigDecimalProperty(BigDecimal val) {
>      this.myBigDecimalProperty = val;
>      this.myBigDecimalProperty.setScale(2);
> }
> 
> Apparently, that will solve your issue.
> Let me know what you get doing that.
> 
> Cheers,
> Daniel Silva.
> 
> On 7/27/05, shilpa <shilpa.pradhan <at> judiciary.state.nj.us> wrote:
> > Larry Meadors <larry.meadors <at> gmail.com> writes:
> > 
> > >
> > > What I mean is if you set the scale on the object, is the real value 
there?
> > > yourBigDecimal.setScale(2);
> > > Larry
> > 
> > 
> > I am geting only 99 from iBatis, not 99.11
> > I am printing what I am getting in set method of value object, and its 
showing
> > me just 99. I called scale() method on BigDecimal object returned by iBatis,
> > and its giving me '0'.
> > 
> > What could be the problem?
> > 
> > Lot of other people at my work place is also facing the same problem.
> > 
> > Can anyone help us regarding this?
> > 
> > Thanks,
> > Shilpa
> > 
> > 
> > 
> > 
> >
> 
> 

now its giving me 99.00 and not 99.11

This is my set method

public void setFinancialSocialsecurity(BigDecimal decimal) {	
		
		System.out.println("setfinancialSocialsecurity " + decimal);	
	
		financialSocialsecurity = decimal.setScale(2);
		System.out.println("setfinancialSocialsecurity scale" + 
decimal.scale());
	}







Mime
View raw message