how can i convert an string to an int or float or double .
Ashutosh Uprety
Ranch Hand
Joined: Nov 30, 2000
Posts: 39
posted
0
for int use Integer.parseInt(string) for long use Long.parseLong(string) for float,double I couldn't find similar fns. but what the heck ... try it out on similar lines :-)
sunil chandwani
Greenhorn
Joined: Dec 20, 2000
Posts: 19
posted
0
you can do it by parse(conversion) methods what it does basically that it converts your String type data to internal binary format and returns as per the requirement
Pratik Khetia
Ranch Hand
Joined: Jun 29, 2001
Posts: 50
posted
0
How can I convert double to an Integer ? How can I convert float to an Integer ?
Roy Tock
Ranch Hand
Joined: Jul 16, 2001
Posts: 83
posted
0
Pratik, to convert double to int or float to int, just cast like so: