Class: QgsNumericFormatContext

A context for numeric formats.

Added in version 3.12.

class qgis.core.QgsNumericFormatContext[source]

Bases: object

__init__()

Constructor for QgsNumericFormatContext.

The context will be populated based on the user’s current locale settings.

__init__(a0: QgsNumericFormatContext)
Parameters:

a0 (QgsNumericFormatContext)

class Interpretation(*values)

Bases: IntEnum

Interpretation of numeric values.

Added in version 3.26.

  • Generic: Generic

  • Latitude: Latitude values

  • Longitude: Longitude values

Generic = 0
Latitude = 1
Longitude = 2
decimalSeparator(self) str[source]

Returns the decimal separator character.

Return type:

str

exponential(self) str[source]

Returns the exponential character.

See also

setExponential()

Return type:

str

expressionContext(self) QgsExpressionContext[source]

Returns the expression context to use when evaluating QgsExpressions.

Added in version 3.40.

Return type:

QgsExpressionContext

interpretation(self) QgsNumericFormatContext.Interpretation[source]

Returns the interpretation of the numbers being converted.

Added in version 3.26.

Return type:

QgsNumericFormatContext.Interpretation

negativeSign(self) str[source]

Returns the negative sign character.

Return type:

str

percent(self) str[source]

Returns the percent character.

See also

setPercent()

Return type:

str

positiveSign(self) str[source]

Returns the positive sign character.

Return type:

str

setDecimalSeparator(self, separator: str)[source]

Returns the decimal separator character.

Parameters:

separator (str)

setExponential(self, character: str)[source]

Sets the exponential character.

See also

exponential()

Parameters:

character (str)

setExpressionContext(self, context: QgsExpressionContext)[source]

Sets the expression context to use when evaluating QgsExpressions.

Added in version 3.40.

Parameters:

context (QgsExpressionContext)

setInterpretation(self, interpretation: QgsNumericFormatContext.Interpretation)[source]

Sets the interpretation of the numbers being converted.

See also

interpretation()

Added in version 3.26.

Parameters:

interpretation (QgsNumericFormatContext.Interpretation)

setNegativeSign(self, character: str)[source]

Sets the negative sign character.

See also

negativeSign()

Parameters:

character (str)

setPercent(self, character: str)[source]

Sets the percent character.

See also

percent()

Parameters:

character (str)

setPositiveSign(self, character: str)[source]

Sets the positive sign character.

See also

positiveSign()

Parameters:

character (str)

setThousandsSeparator(self, separator: str)[source]

Sets the thousands separator character.

Parameters:

separator (str)

setZeroDigit(self, character: str)[source]

Returns the zero digit character.

See also

zeroDigit()

Parameters:

character (str)

thousandsSeparator(self) str[source]

Returns the thousands separator character.

Return type:

str

zeroDigit(self) str[source]

Returns the zero digit character.

See also

setZeroDigit()

Return type:

str