This package provides a class sharred by widget from the data module to format data as text in the same way.
Formatter to convert data to string.
The method toString() returns a formatted string from an input data using parameters set to this object.
It support most python and numpy data, expecting dictionary. Unsupported data are displayed using the string representation of the object (str).
It provides a set of parameters to custom the formatting of integer and float values (setIntegerFormat(), setFloatFormat()).
It also allows to custom the use of quotes to display text data (setUseQuoteForText()), and custom unit used to display imaginary numbers (setImaginaryUnit()).
The object emit an event formatChanged every time a parametter is changed.
Emitted when properties of the formatter change.
Returns the format string controlling how the integer data are formated by this object.
This is the C-style format string used by python when formatting strings with the modulus operator.
Return type: | str |
---|
Set format string controlling how the integer data are formated by this object.
Parameters: | value (str) – Format string (e.g. “%d”, “%i”, “%08i”). This is the C-style format string used by python when formatting strings with the modulus operator. |
---|
Returns the format string controlling how the floating-point data are formated by this object.
This is the C-style format string used by python when formatting strings with the modulus operator.
Return type: | str |
---|
Set format string controlling how the floating-point data are formated by this object.
Parameters: | value (str) – Format string (e.g. “%.3f”, “%d”, “%-10.2f”, “%10.3e”). This is the C-style format string used by python when formatting strings with the modulus operator. |
---|
Returns true if the string data are formatted using double quotes.
Else, no quotes are used.
Set the use of quotes to delimit string data.
Parameters: | useQuote (bool) – True to use quotes. |
---|