I’m am working on a program that can imports a string from a text box and then converts it to another data type so that I can run it through some formulas.
I think that I need to convert it to a double so that it can have decimals but I cant figure out how to convert a string to a double.
Is a double the best way to go and is there any way to convert from a string to a double?
Conversion helpConvert from string to double?
Page 1 of 1
2 Replies - 1217 Views - Last Post: 05 October 2005 - 09:28 AM
Replies To: Conversion help
#2
Re: Conversion help
Posted 05 October 2005 - 09:19 AM
String s = "123.456"; double d1 = Double.valueOf(s.trim()).doubleValue();
is one way to do it...there are several, including parseDouble, etc...
#3
Re: Conversion help
Posted 05 October 2005 - 09:28 AM
Thank you for your help!!!!!!
It worked perfect!!!
It worked perfect!!!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|