I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I can't seem to limit the number of decimal places so that I just have solid numbers. Right now I have 13 places after the decimal, I would like it to be 0.

3 Answers 3


If you create a new field, make it "integer" instead of "real" if you don't want any values after the comma anyway.

Alternatively, use the "toint" function in "conversions".

  • Excellent! Always a great help :)
    – Chewy
    Commented Mar 8, 2013 at 23:05

Open the field calculator, click on new virtual field, assign decimal data type and then use the following code

count("the column you want to limit", 2)

Your new virtual field will be having the same value as your decimal field, but will be limited to 2 decimal numbers.


You don't do that in the field calculator, try the properties of that field, there is a button, num or ... That will allow you to set rounding and precision.

  • No you can't change those.
    – Nathan W
    Commented Mar 8, 2013 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.