wood burning stoves*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
wood burning stoves
 
subject: How to cast a string into a float?