Thanks all of you for your help ,

It worked in this way :

new BigDecimal(sliceVal[j]).setScale(2,5);

sliceVal[] is a double val array

setScale (int1,int2) is a method of BigDecimal int1 is the number of digits
after the decimal point "."  int2 is the rounding method , 5 is the most
effective one in my code
it looks the neighbour digit if it is >=5 or not.

Thanks for all your help again

FIRAT
----- Original Message -----
From: "srinivasanvs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 26, 2001 11:50 AM
Subject: Re: rounding values


> Hai,
> You can try math.round().  This method is available in java.lang package
> -----Original Message-----
> From: Fırat Tiryaki <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Saturday, May 26, 2001 2:18 PM
> Subject: rounding values
>
>
> >Hi all,
> >
> >How can I round values decimally ;
> >
> >example:   I want to round the value 78.2145 to 78.21  or 78.2175 to
78.22
> >is there a method for this or do I have to write my own
> >
> >thanks in advanced
> >
> >FIRAT
> >
>
>___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to