2023-07-01 11:58:00 -04:00
|
|
|
#include <ctype.h>
|
2024-04-19 16:56:29 -07:00
|
|
|
#include <stdbool.h>
|
2023-07-01 11:58:00 -04:00
|
|
|
#include <stdlib.h>
|
2024-04-19 16:56:29 -07:00
|
|
|
|
|
|
|
|
bool isNumeric(const char *s) {
|
|
|
|
|
if (s == NULL || *s == '\0' || isspace(*s)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
char *p;
|
|
|
|
|
strtod(s, &p);
|
2023-07-01 11:58:00 -04:00
|
|
|
return *p == '\0';
|
|
|
|
|
}
|