We don't need this function. Please use:
boost::lexical_cast<double>(some_string) instead;
this throws a bad_lexical_cast exception when the number is not a double.