How can I set the number of decimals for QgsPalLayerSettings object? I used the following code (from QGIS Python Programming Cookbook).e
label = QgsPalLayerSettings()
label.readFromLayer(shp)
label.enabled = True
label.fieldName='tmp_Averag'
label.placement= QgsPalLayerSettings.AroundPoint
label.setDataDefinedProperty(QgsPalLayerSettings.Size,True,True,'8','')
#label.decimals = 2
label.writeToLayer(shp)
QgsMapLayerRegistry.instance().addMapLayers([shp])
I tried to read the API document and I thought
label.decimals = 2
does the job. But it did not work.