Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert String to Float

Status
Not open for further replies.

asm1

Technical User
Oct 9, 2003
77
GB
What is the quickest way to convert a String to float. I a managed to do this but the code covers about 20 lines, is there a string method to do this? At the moment my string is converted to a string buffer and then to type float. thx
 
Thx for a very quick response, I new there would be an easier way. One again thx I will go and give it a try.
 
that worked great thx but i notice this does not work for int is there one that i can use for a type int
 
int i = Integer.parseInt(var);
long l = Long.parseLong(var);
double d = Double.parseDouble(var);

and so on ...

( It helps to read the manual sometimes - )
 
Thanks sedj i actually tried
int i = Int.parse.int(var);
thx again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top