Convert float value to String

2

I'm programming for android, and I'm trying to display a float value found by the getX() function on a Toast, which only displays String values. How do I do this conversion?

    
asked by anonymous 02.07.2018 / 01:03

2 answers

4

To convert a float value to string, you can use the String.valueOf() :

String str = String.valueOf(<valor float a ser convertido>);
    
02.07.2018 / 01:14
0
02.07.2018 / 22:03