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()); }