Reputation: 11
I want to divide two numbers fetched from edit text and save it in a TextView
but I am unable to save a float type Number
into String
tv.setData(div.toString()); //not working
In this code, where tv
is TextView
type variable and div
is float type variable.
Upvotes: 0
Views: 208
Reputation: 560
Use String.valueOf(div)
instead of div.toString()
like so:
tv.setText(String.valueOf(div));
Upvotes: 2