[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

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 <p.vanbreugel@gmail.com>
Date: Wednesday, May 1, 2013 11:48 AM
To: GRASS users email list <grass-user@lists.osgeo.org>
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