double SDBUtil::stringToDouble(char* data) {
int foundDot = 0;
for(char* p = data; *p; p++) {
if (isdigit(*p)) {
continue;
} else if (*p == '.') {
if (foundDot) {
throw strdup("Input wrong float");
} else {
foundDot = 1;
}
} else {
throw strdup("Input wrong float");
}
}
if (!foundDot) {
throw strdup("Input wrong float");
}
return atof(data);
}