38 static void format(
char *,
int,
int,
double,
char);
39 static void ll_parts(
double,
int *,
int *,
double *);
48 format(buf, d, m, s, h);
53 return "dd:mm:ss{N|S}";
63 format(buf, d, m, s, h);
68 return "ddd:mm:ss{E|W}";
79 format(buf, d, m, s, h);
87 static void format(
char *buf,
int d,
int m,
double s,
char h)
92 sprintf(temp,
"%f", s);
93 sscanf(temp,
"%lf", &ss);
103 sprintf(temp,
"0%f", ss);
105 sprintf(temp,
"%f", ss);
107 if (strcmp(temp,
"00") != 0 && strcmp(temp,
"0") != 0)
108 sprintf(buf,
"%d:%02d:%s%c", d, m, temp, h);
110 sprintf(buf,
"%d:%02d%c", d, m, h);
112 sprintf(buf,
"%d%c", d, h);
130 ll_parts(lat, d, m, s);
153 ll_parts(lon, d, m, s);
156 static void ll_parts(
double ll,
171 *s = ((ll - *d) * 60 - *m) * 60;
void G_trim_decimal(char *)
Removes trailing zeros from decimal number.