File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Float value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Float value

Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
Hi All,
I want to get float value of a string, but for small values I get it in the form "6.0E-4". Can any1 help me in getting 0.0006 in Float value???
public class flt1{
public static void main(String kk[]){
String val = "0.0006";
Float resultflt = new Float(val);
System.out.println("Flt val is "+resultflt.floatValue());
Thanks in advance.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Pretty please don't post the same question in multiple categories. Look in the Beginner's Forum for at least one idea so far.
I agree. Here's the link:
subject: Float value
It's not a secret anymore!