There are many questions on validation of real numbers using different artificial methods. You don't need any of them. Say, the number is declared as
double
. The the validation is:
string numericLiteral =
bool isValid = double.TryParse(numericLiteral, out value);
That's is. Nobody cares what's exactly wrong in the literal; compilers never show it in the error description. You can only show the value of the literal and tell the user if
isValid == false
: "invalid numeric format".
—SA