Преглед на файлове

show input value to full precision (or near enough); merge from devbr6

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44636 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman преди 14 години
родител
ревизия
f9847e9d10
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      raster/r.what.color/main.c
  2. 1 1
      raster/r.what.color/r.what.color.html

+ 2 - 2
raster/r.what.color/main.c

@@ -54,10 +54,10 @@ static int do_value(const char *buf, RASTER_MAP_TYPE type,
 	    return 0;
 	}
 	if (!Rast_get_d_color(&fval, &red, &grn, &blu, colors)) {
-	    fprintf(stdout, "%f: *\n", fval);
+	    fprintf(stdout, "%.15g: *\n", fval);
 	    return 0;
 	}
-	fprintf(stdout, "%f: ", fval);
+	fprintf(stdout, "%.15g: ", fval);
 	fprintf(stdout, fmt, red, grn, blu);
 	fprintf(stdout, "\n");
 	return 1;

+ 1 - 1
raster/r.what.color/r.what.color.html

@@ -18,7 +18,7 @@ r.what.color input=elevation.dem value=1500
 <p>
 If the input map is an integer (CELL) map, the category will be
 written as an integer (no decimal point), otherwise it will be written
-in floating point format (<i>printf("%f")</i> format).
+in floating point format (<i>printf("%.15g")</i> format).
 
 <p>
 If the lookup fails for a value, the color will be output as an