Class: QgsBasicNumericFormat¶
A numeric formatter which returns a simple text representation of a value.
Added in version 3.12.
Class Hierarchy¶
Base classes¶
Abstract base class for numeric formatters, which allow for formatting a numeric value for display. |
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 an override character for the decimal separator character. |
|
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. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsBasicNumericFormat. See the FAQ for more details.
Sets the format's configuration. |
|
Sets the maximum number of decimal places to show. |
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:
- virtual 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
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)
- virtual setNumberDecimalPlaces(self, places: int)[source]¶
Sets the maximum number of decimal
places
to 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
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 [source]¶
Returns
True
if a leading plus sign will be shown for positive values.See also
- Return type:
bool
- showThousandsSeparator(self) bool [source]¶
Returns
True
if the thousands grouping separator will be shown.See also
- Return type:
bool
- showTrailingZeros(self) bool [source]¶
Returns
True
if trailing zeros will be shown (up to the specifiednumberDecimalPlaces()
).See also
See also
- Return type:
bool