This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Float value
jQuery in Action, 3rd edition