Google Brother Up

2008/03/04

Convert from String to Float in C#

There are 2 ways: -

1) String to Double to Float (indirectly)
fc.Price = (float)Convert.ToDouble(txtPrice.Text);

2) String to Float (directly)
fc.Price = float.Parse(txtPrice.Text);

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx