permaculture playing cards*
The moose likes Beginning Java and the fly likes How to cast a string into a float? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to cast a string into a float?" Watch "How to cast a string into a float?" New topic
Author

How to cast a string into a float?

George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
I want to make a string like "123" to a float number like 123.000. How can I achieve this? Thanks for help!

Regards,
Have a nice day!


THINK!
jim gotti
Ranch Hand

Joined: Jul 02, 2002
Posts: 36
Float.parseFloat(String) may help?


If you need to keep the precision of 3 decimals this thread may help
George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
Thanks a lot. It does work
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to cast a string into a float?
 
Similar Threads
conversion from String to any data type
choosing method
floats and Float objects
How to convert String to float with exact decimal value
J2me 8/9