+ 2

String

how do I convert a float or any type to a string and vise versa

26th Oct 2017, 12:48 PM
Smart
4 odpowiedzi
+ 2
In python, x=0.7 y=str(x) In c++ x=0.7 string y= tostr(x); This converts float into string.
26th Oct 2017, 12:57 PM
Lakshay
Lakshay - avatar
0
What language? In some languages you can use the object.toSring() method.
26th Oct 2017, 12:50 PM
josh mizzi
josh mizzi - avatar
0
Single line in python x = str(float) # float is the decimal
27th Oct 2017, 5:09 PM
#RahulVerma
#RahulVerma - avatar