Thanks for the response. Any idea how you do this? like a small sample of some sort to get me going. Appreciate it if you could.Nerseus said:Typically you have to write your own function for this. The function is normally written with a Try/Catch that attempts the conversion. If it converts, the function returns true. If it doesn't, it returns false.
Depending on the type of numeric you want to return true (whole numbers only, floats, "$" and "," chars), you'll have to pick the right conversion function.
-nerseus
[COLOR=DarkSlateBlue]try[/COLOR]
{
i = System.Int32.Parse(text, System.Globalization.NumberStyles.Currency);
[COLOR=DarkOrchid] // Parse the text according to currency standards.
// If it cannot be parsed, an exception is thrown.
// Going to the catch block. [/COLOR]
MessageBox.Show("Conversion succeeded." + System.Convert.ToString(i));
}
[COLOR=DarkSlateBlue]catch[/COLOR] (System.Exception ex)
{
[COLOR=DarkOrchid]// If text cannot be parsed.[/COLOR]
MessageBox.Show("Conversion failed.");
MessageBox.Show(ex.ToString());
};