Thursday, 3 October 2013

adding string as integer

adding string as integer

in my application i have got 0.00 in edit text.next when i enter 2or3 or
any digit its getting concat with 0.00 and getting 0.003.
if(item.equals("0.00")){
item=item+string;}
i changed the code.but this time too its getting an error
if(item.equals("0.00")){
int a=Integer.parseInt(item.toString());
int b=Integer.parseInt(string.toString());
int c=a+b;
item=String.valueOf(c);}

No comments:

Post a Comment