With all you checks, you cannot guarantee valid double floating point format in all cases. So, no matter what logic you want to apply, use
double.TryParse
instead of
Convert
:
http://msdn.microsoft.com/en-us/library/system.double.aspx[
^].
"Convert" is a bad word for that, this is really parsing, not "conversion"...
—SA