string - how to convert EditText control's value in to float value in android -


im receiving value edittext control. , want value calculation need convert float value how can that?

i tried below getting null pointer exception:

float ip1=integer.getinteger(t1.gettext().tostring()); 

any soln?

try this:

string str = t1.gettext().tostring(); float ip1 = new float(str); system.out.println("float value = "+ip1); 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -