[program-java] Re: Simple problem with String to double

  • From: "Sina Bahram" <sbahram@xxxxxxxxx>
  • To: <program-java@xxxxxxxxxxxxx>
  • Date: Fri, 22 Apr 2011 15:32:17 -0400

double b = Double.toDouble(a);
 
take care,
Sina
 
 
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Roger Woolgrove
Sent: Friday, April 22, 2011 3:29 PM
To: JavaProgramming
Subject: [program-java] Simple problem with String to double
 
Hello all,
 
I'm struggling to recall how to convert a String of numbers (ie 42.52) to a 
double value that I may use the value for mathematical
functions.
 
Could someone please supply syntax to change the string below into a double 
value.
 
Many thanks.
 
String a = "42.5"
double b = (code here to change a to double)
 
Roger
 

Other related posts: