I created a TIN raster for an height values. The color ramp is:

enter image description here

but i want to delete all the zero numbers and stay with only integers like this( i do it manually in the layer properties):

enter image description here

How can i change the values in automatic way?

1 Answer 1


Unfortunately there is no way to format the numbers of the legend - by removing all decimal numbers - directly in QGIS.

The fastest way to solve this problem is to save the style as qml file, then open text editor such as Notepad++ and use 'Find and Replace'. Use find .000000 and replace with nothing (keep replace field empty), and click on Replace All, if you are sure there is no other .000000 that you want to keep, otherwise click on Replace button instead of Replace All to change them one by one. Finally save the qml file and load it again in QGIS.

I know it is not perfect, and there should be an easy way to do this, but until the QGIS developer team add an option to format the legend's numbers, this is the best and easy way, especially if you have a long list of numbers more than 10 values and you need to format the numbers many time.

But if the number of values is few such as 5 values or less, it is easier and faster to do it manually.

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.