Hi

The following function in java.lang.Math can be more appropriate.

i = java.lang.Math.round(( i * 100.0 ) ) / 100.0;

Regards
P a r a m.



-----Original Message-----
From: Antoni Reus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 21, 2001 8:38 PM
To: [EMAIL PROTECTED]
Subject: Re: Simple java question


float  i = 1.715
result = Math.floor(( i * 100.0 ) + 0.5) / 100.0


----- Original Message -----
From: "Alireza Nahavandi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 21, 2001 3:59 PM
Subject: Simple java question


> Hi All,
>
> How can I round up a float number in java like 1.715 to 1.72
>
> Thank you.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com
This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.

                Visit us at http://www.cognizant.com

Reply via email to