Check and convert a string to a double
BOOL is_str_numeric( LPCSTR lpcsz, double * lpVal = NULL, DWORD dwCntrl = 0 )
true if str is a valid numeric string,otherwise false
EX1
void is_str_numeric_ex1() { double d = 0; string str = "123.456";//change to "abc" to see different result; bool bRet = is_str_numeric(str , &d); if(bRet) printf("\"%s\" is converted to %f \n" ,str ,d); else printf("\"%s\" can not be converted \n" ,str); }
is_numeric, is_str_numeric_integer, is_str_numeric_integer_with_args
origin.h