OSDN Git Service

I was library can be compiled 20140223
[zither/ds-zither.git] / libms / ch_float.c
1 // ch_float.c
2 // $Id: $
3
4
5 #include<stdio.h>
6 #include<string.h>
7 #include<ctype.h>
8
9
10
11 /* -------------- CH_INT -------------- */
12 int ch_float(char * data)
13 {
14 int count;
15 int ret = 0;
16 int max = (int)strlen(data);
17
18 for(count = 0; count < max; count++){
19    if(0 == isdigit((int)data[count])){
20       if('.' != data[count] && ' ' != data[count]){
21          ret = -1;
22          break;
23          }
24       }
25    }
26
27
28 return ret;
29 }
30
31
32
33
34