88afade357d881a8a5775af64db2a6b693460afa kent Thu Feb 19 21:17:48 2015 -0800 Adding isNumericString function. diff --git src/lib/common.c src/lib/common.c index 7a0c398..d8e3335 100644 --- src/lib/common.c +++ src/lib/common.c @@ -3397,30 +3397,38 @@ strcpy(pathBuf, path); if (*next == '/') next++; while((*next != '\0') && (next = strchr(next, '/')) != NULL) { *next = '\0'; makeDir(pathBuf); *next = '/'; next++; } makeDir(pathBuf); } +boolean isNumericString(char *s) +/* Return TRUE if string is numeric (integer or floating point) */ +{ +char *end; +strtod(s, &end); +return (end != s && *end == 0); +} + char *skipNumeric(char *s) /* Return first char of s that's not a digit */ { while (isdigit(*s)) ++s; return s; } char *skipToNumeric(char *s) /* skip up to where numeric digits appear */ { while (*s != 0 && !isdigit(*s)) ++s; return s; }