Class: QgsExpressionBasedNumericFormat

A numeric formatter which uses a QgsExpression to calculate the text representation of a value.

Added in version 3.40.

Class Hierarchy

Inheritance diagram of qgis.core.QgsExpressionBasedNumericFormat

Base classes

QgsNumericFormat

Abstract base class for numeric formatters, which allow for formatting a numeric value for display.

Methods

expression

Returns the expression used to calculate the text representation of a value.

setExpression

Sets the expression used to calculate the text representation of a value.

class qgis.core.QgsExpressionBasedNumericFormat[source]

Bases: QgsNumericFormat

expression(self) str[source]

Returns the expression used to calculate the text representation of a value.

See also

setExpression()

Return type:

str

setExpression(self, expression: str | None)[source]

Sets the expression used to calculate the text representation of a value.

The expression can utilize @value to retrieve the numeric value to represent.

See also

expression()

Parameters:

expression (Optional[str])