Class: QgsBasicNumericFormat¶
- class qgis.core.QgsBasicNumericFormat¶
Bases:
QgsNumericFormat
A numeric formatter which returns a simple text representation of a value.
New in version 3.12.
QgsBasicNumericFormat() Default constructor
QgsBasicNumericFormat(
QgsBasicNumericFormat
)Methods
- rtype:
QgsNumericFormat
- param context:
- param configuration:
Returns any override for the decimal separator character.
- param value:
- rtype:
str
Returns the maximum number of decimal places to show.
Returns the rounding type, which controls the behavior of the
numberDecimalPlaces()
setting.Sets the format's
configuration
.Sets an override
character
for the decimal separator character.Sets the maximum number of decimal
places
to show.Sets the rounding
type
, which controls the behavior of thenumberDecimalPlaces()
setting.Sets whether a leading plus sign will be shown for positive values.
Sets whether the thousands grouping separator will be shown.
Sets whether trailing zeros will be shown (up to the specified
numberDecimalPlaces()
).Sets an override
character
for the thousands separator character.Returns
True
if a leading plus sign will be shown for positive values.Returns
True
if the thousands grouping separator will be shown.Returns
True
if trailing zeros will be shown (up to the specifiednumberDecimalPlaces()
).- rtype:
int
Returns any override for the thousands separator character.
- rtype:
str
Attributes
- DecimalPlaces = 0¶
- class RoundingType¶
Bases:
int
- SignificantFigures = 1¶
- clone(self) QgsNumericFormat ¶
- Return type:
- configuration(self, context: QgsReadWriteContext) Dict[str, Any] ¶
- Parameters:
context (QgsReadWriteContext) –
- Return type:
Dict[str, Any]
- create(self, configuration: Dict[str, Any], context: QgsReadWriteContext) QgsNumericFormat ¶
- Parameters:
configuration (Dict[str) –
context (QgsReadWriteContext) –
- Return type:
- decimalSeparator(self) str ¶
Returns any override for the decimal separator character. If an invalid QChar is returned, then the QGIS locale separator is used instead.
See also
- Return type:
str
- formatDouble(self, value: float, context: QgsNumericFormatContext) str ¶
- Parameters:
value (float) –
context (QgsNumericFormatContext) –
- Return type:
str
- id(self) str ¶
- Return type:
str
- numberDecimalPlaces(self) int ¶
Returns the maximum number of decimal places to show.
See also
See also
- Return type:
int
- roundingType(self) QgsBasicNumericFormat.RoundingType ¶
Returns the rounding type, which controls the behavior of the
numberDecimalPlaces()
setting.See also
- Return type:
- setConfiguration(self, configuration: Dict[str, Any], context: QgsReadWriteContext)¶
Sets the format’s
configuration
.- Parameters:
configuration (Dict[str) –
context (QgsReadWriteContext) –
- setDecimalSeparator(self, character: str)¶
Sets an override
character
for the decimal separator character. If an invalid QChar is set, then the QGIS locale separator is used instead.See also
- Parameters:
character (str) –
- setNumberDecimalPlaces(self, places: int)¶
Sets the maximum number of decimal
places
to show.See also
See also
- Parameters:
places (int) –
- setRoundingType(self, type: QgsBasicNumericFormat.RoundingType)¶
Sets the rounding
type
, which controls the behavior of thenumberDecimalPlaces()
setting.See also
- Parameters:
type (QgsBasicNumericFormat.RoundingType) –
- setShowPlusSign(self, show: bool)¶
Sets whether a leading plus sign will be shown for positive values.
See also
- Parameters:
show (bool) –
- setShowThousandsSeparator(self, show: bool)¶
Sets whether the thousands grouping separator will be shown.
See also
- Parameters:
show (bool) –
- setShowTrailingZeros(self, show: bool)¶
Sets whether trailing zeros will be shown (up to the specified
numberDecimalPlaces()
).See also
See also
- Parameters:
show (bool) –
- setThousandsSeparator(self, character: str)¶
Sets an override
character
for the thousands separator character. If an invalid QChar is set, then the QGIS locale separator is used instead.See also
- Parameters:
character (str) –
- showPlusSign(self) bool ¶
Returns
True
if a leading plus sign will be shown for positive values.See also
- Return type:
bool
- showThousandsSeparator(self) bool ¶
Returns
True
if the thousands grouping separator will be shown.See also
- Return type:
bool
- showTrailingZeros(self) bool ¶
Returns
True
if trailing zeros will be shown (up to the specifiednumberDecimalPlaces()
).See also
See also
- Return type:
bool
- sortKey(self) int ¶
- Return type:
int
- thousandsSeparator(self) str ¶
Returns any override for the thousands separator character. If an invalid QChar is returned, then the QGIS locale separator is used instead.
See also
- Return type:
str
- visibleName(self) str ¶
- Return type:
str