Pārlūkot izejas kodu

v.what.rast: fix fp precision

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52869 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 gadi atpakaļ
vecāks
revīzija
65a62049d9
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      vector/v.what.rast/main.c

+ 5 - 5
vector/v.what.rast/main.c

@@ -124,10 +124,10 @@ int main(int argc, char *argv[])
     fd = Rast_open_old(opt.rast->answer, "");
 
     out_type = Rast_get_map_type(fd);
-    
-    width = 7;
-    if (out_type == DCELL_TYPE)
-	width = 15;
+
+    width = 15;
+    if (out_type == FCELL_TYPE)
+	width = 7;
 
     /* TODO: Later possibly category labels */
     /* 
@@ -323,7 +323,7 @@ int main(int argc, char *argv[])
 		sprintf(buf, "NULL");
 	    }
 	    else {
-		sprintf(buf, "%.*f", width, cache[point].dvalue);
+		sprintf(buf, "%.*g", width, cache[point].dvalue);
 	    }
 	}
 	db_append_string(&stmt, buf);