[GRASS-SVN] r38751 - grass/branches/releasebranch_6_4/raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 16 04:18:38 EDT 2009


Author: hamish
Date: 2009-08-16 04:18:37 -0400 (Sun, 16 Aug 2009)
New Revision: 38751

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

Modified: grass/branches/releasebranch_6_4/raster/r.colors/rules.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.colors/rules.c	2009-08-16 08:17:48 UTC (rev 38750)
+++ grass/branches/releasebranch_6_4/raster/r.colors/rules.c	2009-08-16 08:18:37 UTC (rev 38751)
@@ -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