This question already has an answer here:
I have single band raster whose values somehow were set to something like
1.399999999 instead of
1.29999999999 instead of
1.3 (I'm not sure about the number of 9's there.),
1.2000047683 instead of
1.2. While some pixels do have a value
I actually need all values to one decimal place like
0.5, 1.2, 1.3, 1.4. For this I searched around and bumped into one answer in stackexchange. I did not find
gdal.calc as suggested but found
r.mapcalculator (dialog box looked similar). I then used the function
round(A,1). But it did not work.
How can I round the pixel values to one decimal place ?
When I used raster calculator
raster@1 * 100 the new raster formed has values like
50, 120, 130, 140 and then again used
newraster@1 / 100 to obtain
0.5, 1.20000047683, 1.299999999, 1.399999999.