You can convert, and convert back.  I think that this would work:

r.mapcalc "output = round(input * 1000)/1000.0"

-- Adam


From: Paulo van Breugel <[email protected]<mailto:[email protected]>>
Date: Wednesday, May 1, 2013 11:48 AM
To: GRASS users email list 
<[email protected]<mailto:[email protected]>>
Subject: [GRASS-user] rounding raster values

Hi,

I have floating raster layers which values I want to round to x decimal places. 
I wonder if there is an function that allows me to round raster values to 
values x decimal places? There is the option round() in r.mapcalc, but that 
rounds the raster values to nearest integer. I can work with integer values, 
using e.g., r.mapcalc "output = round(input * 1000)". But an option to round 
values would be more convenient. Any suggestion?

Rgds

Paulo
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to