[GRASS-SVN] r38749 - grass/branches/develbranch_6/raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 16 04:17:35 EDT 2009


Author: hamish
Date: 2009-08-16 04:17:34 -0400 (Sun, 16 Aug 2009)
New Revision: 38749

Modified:
   grass/branches/develbranch_6/raster/r.colors/rules.c
Log:
use %15.g instead of %.25f (trac #335)

Modified: grass/branches/develbranch_6/raster/r.colors/rules.c
===================================================================
--- grass/branches/develbranch_6/raster/r.colors/rules.c	2009-08-16 08:03:14 UTC (rev 38748)
+++ grass/branches/develbranch_6/raster/r.colors/rules.c	2009-08-16 08:17:34 UTC (rev 38749)
@@ -44,8 +44,8 @@
 	if (is_fp) {
 	    char minstr[64], maxstr[64];
 
-	    sprintf(minstr, "%.25f", (double)min);
-	    sprintf(maxstr, "%.25f", (double)max);
+	    sprintf(minstr, "%.15g", (double)min);
+	    sprintf(maxstr, "%.15g", (double)max);
 	    G_trim_decimal(minstr);
 	    G_trim_decimal(maxstr);
 	    fprintf(stderr, _("fp: Data range is %s to %s\n"), minstr,
@@ -60,7 +60,7 @@
 	return 0;
 
     G_get_d_color_range(&rulemin, &rulemax, colors);
-    G_debug(3, "rulemin=%.1f rulemax=%.1f", rulemin, rulemax);
+    G_debug(3, "rulemin=%.3f rulemax=%.3f", rulemin, rulemax);
 
     if (rulemin > min || rulemax < max)
 	G_warning(_("Your color rules do not cover the whole range of data!\n (rules %f to %f but data %f to %f)"),



More information about the grass-commit mailing list