String to Float

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
 
G

Guest

hi
you can also use Convert.ToSingle Method

regards
Ansil
Dimensions
Technopark
TVM
(e-mail address removed)
 
B

Bret Pehrson

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.
 
R

Ravichandran J.V.

D

Dave

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top