00001
00017 #include <stdio.h>
00018 #include <grass/gis.h>
00019
00020
00021 static int format_double(double, char *);
00022
00023
00036 int G_format_northing(double north, char *buf, int projection)
00037 {
00038 if (projection == PROJECTION_LL)
00039 G_lat_format(north, buf);
00040 else
00041 format_double(north, buf);
00042
00043 return 0;
00044 }
00045
00046
00059 int G_format_easting(double east, char *buf, int projection)
00060 {
00061 if (projection == PROJECTION_LL)
00062 G_lon_format(east, buf);
00063 else
00064 format_double(east, buf);
00065
00066 return 0;
00067 }
00068
00069
00082 int G_format_resolution(double res, char *buf, int projection)
00083 {
00084 if (projection == PROJECTION_LL)
00085 G_llres_format(res, buf);
00086 else
00087 format_double(res, buf);
00088
00089 return 0;
00090 }
00091
00092 static int format_double(double value, char *buf)
00093 {
00094 sprintf(buf, "%.8f", value);
00095 G_trim_decimal(buf);
00096
00097 return 0;
00098 }