static gfloat strtofloat(gchar *num) /* Function to convert string to float number ***Note I have no check for errors in string*** */ { gfloat ret = 0.f; gchar *pchar; gfloat n; gfloat dec = 0.f; pchar = num; while(*pchar != '\0' && *pchar !=' ') { if (*pchar == '.') dec = 10.f; else { if (dec) { n = ((gfloat) (*pchar - '0')) / dec; dec *= 10.f; } else { n = (gfloat) (*pchar - '0'); ret *= 10.f; } ret += n; } pchar++; } return(ret); }