29 #include <Exception/Exception.h> 48 if ( NULL == txt ||
'\0' == *txt )
49 throw Exception(
"suplib::str2d( ) : Empty field" );
53 double result = strtod( txt, &ptr );
55 if ( ERANGE == errno )
56 throw Exception(
"suplib::str2d( " + std::string( txt ) +
57 ") : Variable overflow" );
60 throw Exception(
"suplib::str2d( " + std::string( txt ) +
61 " ) Not a number, problem at `" + std::string( ptr ) +
"'" );
double str2d(const char *txt)
convert string to double-precision number