float calculateLatitude() {
char input[] = "2234.7630S";
char sDeg[2];
char sMinSec[7];
float deg;
float minSec;
int index = 0;
while (*input) {
if (index < 2) {
*sDeg++ = *input++;
}
else if (index >= 2 && index < 9) {
*sMinSec++ = *input++;
}
else {
deg = atof(sDeg);
minSec = atof(sMinSec);
deg = deg + minSec / 60.0;
if (*input == 'S') {
deg = -deg;
++input;
}
}
++index;
}
return deg;
}