Browse Source

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 years ago
parent
commit
f9847e9d10
2 changed files with 3 additions and 3 deletions
  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;
 	    return 0;
 	}
 	}
 	if (!Rast_get_d_color(&fval, &red, &grn, &blu, colors)) {
 	if (!Rast_get_d_color(&fval, &red, &grn, &blu, colors)) {
-	    fprintf(stdout, "%f: *\n", fval);
+	    fprintf(stdout, "%.15g: *\n", fval);
 	    return 0;
 	    return 0;
 	}
 	}
-	fprintf(stdout, "%f: ", fval);
+	fprintf(stdout, "%.15g: ", fval);
 	fprintf(stdout, fmt, red, grn, blu);
 	fprintf(stdout, fmt, red, grn, blu);
 	fprintf(stdout, "\n");
 	fprintf(stdout, "\n");
 	return 1;
 	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>
 <p>
 If the input map is an integer (CELL) map, the category will be
 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
 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>
 <p>
 If the lookup fails for a value, the color will be output as an
 If the lookup fails for a value, the color will be output as an