37 static void format(
char *,
int,
int,
double,
char);
38 static void ll_parts(
double,
int *,
int *,
double *);
47 format(buf, d, m, s, h);
52 return "dd:mm:ss{N|S}";
62 format(buf, d, m, s, h);
67 return "ddd:mm:ss{E|W}";
78 format(buf, d, m, s, h);
86 static void format(
char *buf,
int d,
int m,
double s,
char h)
91 sprintf(temp,
"%f", s);
92 sscanf(temp,
"%lf", &ss);
102 sprintf(temp,
"0%f", ss);
104 sprintf(temp,
"%f", ss);
106 if (strcmp(temp,
"00") != 0 && strcmp(temp,
"0") != 0)
107 sprintf(buf,
"%d:%02d:%s%c", d, m, temp, h);
109 sprintf(buf,
"%d:%02d%c", d, m, h);
111 sprintf(buf,
"%d%c", d, h);
129 ll_parts(lat, d, m, s);
152 ll_parts(lon, d, m, s);
155 static void ll_parts(
double ll,
170 *s = ((ll - *d) * 60 - *m) * 60;
void G_trim_decimal(char *)
Removes trailing zeros from decimal number.