6

I am making a throughput calculator where the user inputs data and the duration it took to download or upload and my intention is to display the throughput in varying units.

However, I cannot find a way to convert float to CharSequence so I can append it to my TextView.

Any help is appreciated.

Thanks

mskfisher
  • 3,291
  • 4
  • 35
  • 48
Parth
  • 1,226
  • 7
  • 28
  • 49

3 Answers3

16

This should do the trick:

string s = Float.toString(myFloat);
Unknown1987
  • 1,671
  • 13
  • 30
9

String.valueOf(thisIsYourFloat) will work.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

What about this:

myFloat+""

.-