Tuesday, March 15, 2016

How do I convert to a float in C#?

flight.Duration = float.Parse(Convert.ToString(dataRow["Duration"]));

 
 

Addendum 3/16/2016: It has been suggested to me that Convert.ToSingle() is the better way to go.

No comments:

Post a Comment