Extraction of decimal number from a string [on hold]

The output of below code is (13, 2, 12) What should I do if I want to extract the 0.2 from the string? What should I add?

#include <stdlib.h> #include<string.h>   int main() {     int val;     char c []="13.2x+12y";      char*p=c;       while(*p){           if( isdigit(*p)||((*p=='-'||*p=='+') && isdigit(*(p+1)) )){              long val=strtol(p, &p,10);              printf("%ld\n", val);           }else{              p++;          }      } }