I am calculating the areas of my polygons in Qgis using $area and everything works fine until I click on "save". All my values are rounded to an integer. I tired setting the output field type to decimal but still see the same problem? Any solution to that? I am using Qgis 1.8
2 Answers
Apart from setting the precison to a value greater than zero, I would suggest to increase the field width as well, because the given precision reduces the remaining field width.
A field width of 15 and precision 3 should work well.
-
I had the same issue as the OP this is the answer that worked for me– user32496Aug 2, 2017 at 3:32
If I calculate the $area in an integer field I'have got the same result (there is an automatic conversion):
I think you must specify the "real" type when you create a field :
-
I thought the same but this behaviour does not change. It still rounds the number...It works if I set it to text but then I am not able to use the numbers for calculations Jul 10, 2013 at 15:36
-
4it's because, you have to also define the precision (see input below the field type). For example, pass the value to 3 and you will see the change.– simoJul 10, 2013 at 15:40