Converting a float to a string

  • Thread starter Thread starter eric.goforth
  • Start date Start date
E

eric.goforth

Hello,

float.parse(MyString)

seems to work to convert a string to a float, but how do I change it
back?

e.g.

(string) (Myfloat1 - Myfloat2)

doesn't seem to work.
 
Thanks, that works. The intellisense seems to choke on it though:

float float1;
float float2;

string mystring;

mystring=(float1-float2).ToString();

When I type the "." after (float1-float2) I don't see a list of
methods.

If I type in ".ToString();" manually it seems to compile though.

-Eric
 
Yeah. Intellisense does not like to show options in this situation, I guess.
I've noticed that too. But, as you said, it's valid and the compiler handles
it as it should.
 
just : float myFloat = float1-float2;
string str;
str = myFloat.ToString();
that's ok.
 
Back
Top