Given a textbox containing the number (text) '123.234345456567', how do I get this converted to a float variable in the underlying c# code ?
Printable View
Given a textbox containing the number (text) '123.234345456567', how do I get this converted to a float variable in the underlying c# code ?
But this one will throw an exception if the input is not a valid float.Code:float f = float.Parse(TextBox1.Text);
Instead use
Code:float f;
bool valid = float.TryParse(TextBox1.Text, out f);
Thanks, Danny. I figured it out. See my previous post for an explanation of the problem I was having.
http://www.codeguru.com/forum/showthread.php?t=509782
:)