Class: QgsBasicNumericFormat¶
A numeric formatter which returns a simple text representation of a value.
Added in version 3.12.
Class Hierarchy¶
Base classes¶
A numeric formatter allows for formatting a numeric value for display, using a variety of different formatting techniques (e.g. as scientific notation, currency values, percentage values, etc)  | 
Subclasses¶
A numeric formatter which returns a text representation of a direction/bearing.  | 
|
A numeric formatter which returns a text representation of a currency value.  | 
|
A numeric formatter which returns a text representation of a geographic coordinate (latitude or longitude).  | 
|
A numeric formatter which returns a text representation of a percentage value.  | 
|
A numeric formatter which returns a scientific notation representation of a value.  | 
Methods
Returns any override for the decimal separator character.  | 
|
Returns the maximum number of decimal places to show.  | 
|
Returns the rounding type, which controls the behavior of the   | 
|
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 the   | 
|
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   | 
|
Sets an override character for the thousands separator character.  | 
|
Returns   | 
|
Returns   | 
|
Returns   | 
|
Returns any override for the thousands separator character.  | 
Attributes
- class qgis.core.QgsBasicNumericFormat[source]¶
 Bases:
QgsNumericFormat- __init__()
 Default constructor
- __init__(a0: QgsBasicNumericFormat)
 - Parameters:
 
- DecimalPlaces = 0¶
 
- class RoundingType¶
 Bases:
int
- SignificantFigures = 1¶
 
- decimalSeparator(self) str[source]¶
 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
- numberDecimalPlaces(self) int[source]¶
 Returns the maximum number of decimal places to show.
See also
See also
- Return type:
 int
- roundingType(self) QgsBasicNumericFormat.RoundingType[source]¶
 Returns the rounding type, which controls the behavior of the
numberDecimalPlaces()setting.See also
- Return type:
 
- setConfiguration(self, configuration: Dict[str, Any], context: QgsReadWriteContext)[source]¶
 Sets the format’s
configuration.- Parameters:
 configuration (Dict[str, Any])
context (QgsReadWriteContext)
- setDecimalSeparator(self, character: str)[source]¶
 Sets an override
characterfor 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)[source]¶
 Sets the maximum number of decimal
placesto show.See also
See also
- Parameters:
 places (int)
- setRoundingType(self, type: QgsBasicNumericFormat.RoundingType)[source]¶
 Sets the rounding
type, which controls the behavior of thenumberDecimalPlaces()setting.See also
- Parameters:
 
- setShowPlusSign(self, show: bool)[source]¶
 Sets whether a leading plus sign will be shown for positive values.
See also
- Parameters:
 show (bool)
- setShowThousandsSeparator(self, show: bool)[source]¶
 Sets whether the thousands grouping separator will be shown.
See also
- Parameters:
 show (bool)
- setShowTrailingZeros(self, show: bool)[source]¶
 Sets whether trailing zeros will be shown (up to the specified
numberDecimalPlaces()).See also
See also
- Parameters:
 show (bool)
- setThousandsSeparator(self, character: str)[source]¶
 Sets an override
characterfor 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[source]¶
 Returns
Trueif a leading plus sign will be shown for positive values.See also
- Return type:
 bool
- showThousandsSeparator(self) bool[source]¶
 Returns
Trueif the thousands grouping separator will be shown.See also
- Return type:
 bool
- showTrailingZeros(self) bool[source]¶
 Returns
Trueif trailing zeros will be shown (up to the specifiednumberDecimalPlaces()).See also
See also
- Return type:
 bool