String to Float

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I am trying to compile some code that takes an input value from a combo box
named comRate. I am having difficulties trying to assign this value from the
comRate combo box to a float data type variable named input. There needs to
be some a conversion from a string to a float data type but I am not sure
how to do it.

Any help would be greatly appreciated. Thanks
 
hi
you can also use Convert.ToSingle Method

regards
Ansil
Dimensions
Technopark
TVM
(e-mail address removed)
 
Dave said:
I am trying to compile some code that takes an input value from a combo box
named comRate. I am having difficulties trying to assign this value from the
comRate combo box to a float data type variable named input. There needs to
be some a conversion from a string to a float data type but I am not sure
how to do it.

Any help would be greatly appreciated. Thanks

Parse and TryParse.
 
Thanks to all of you that answered my question. All the methods you have
posted worked and I knew there was more than one way to do it and I had
tried to use the float.Parse method and it didn't work I must have used
Float.Parse because it also works as long as I don't capitalize the " f "...
so much to learn. But thanks again
 
Back
Top