[program-java] Simple problem with String to double

  • From: "Roger Woolgrove" <rawoolgrove@xxxxxxxxx>
  • To: "JavaProgramming" <program-java@xxxxxxxxxxxxx>
  • Date: Fri, 22 Apr 2011 20:28:34 +0100

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: