The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



DisplayType


Unit:SDL_numlab
Class: TNumLab
Declaration: property DisplayType: TDisplay;

The property DisplayType determines the format of the numeric value displayed in the label box. The number of significant places is controlled by the property Precision. There are the following formats available:

dtBin The number is rounded to the nearest integer and displayed as a binary string. The number of digits is defined by the property Precision.
dtDateTime The numeric value is regarded as a date time value and is displayed using the formatting information contained in the property DTFormat (the property Precision has no meaning in this case)
dtDeg The numeric value is regarded as a degree value and displayed as decimal degrees. The number of decimal places is controlled by the property Precision. An example of the resulting display can be found in the description of TDegreeFormat.
dtDegMin The numeric value is regarded as a degree value and displayed as integer degrees and decimal arc minutes. The number of decimal places of the arc minutes is controlled by the property Precision. An example of the resulting display can be found in the description of TDegreeFormat.
dtDegMinSec The numeric value is regarded as a degree value and displayed as integer degrees and arc minutes, and decimal arc seconds. The number of decimal places of the arc seconds is controlled by the property Precision. An example of the resulting display can be found in the description of TDegreeFormat.
dtExp The number is displayed in exponential notation using Precision significant places.
dtEEng The number is displayed using the unit prefix format commonly used in electrical engineering. The prefix is appended to the number (i.e. the number 18169 is displayed as 1.82k if the Precision is set to 3). The property Precision controls the number of significant digits. For details on the format, please consult the description of the function EEngStr (which is used to format the number).
dtEEngNoDP Similar to the display type dtEEng with the difference that the decimal point is replaced by the prefix (i.e. the number 18169 is displayed as 1k82 if the Precision is set to 3). For details on the format, please consult the description of the function EEngStr (which is used to format the number).
dtFixP A fixed number of decimal places is used (determined by the property Precision ).
dtFloat The numeric value is displayed with Precision significant places. Any excess zeroes behind the decimal point are removed.
dtHex The number is rounded to the nearest integer and displayed as a hexadecimal string with Precision places. Please note that the valid input range for a hexadecimal display is -231 to +232-1, which is somewhat unusual. However, this setup ensures that the hex display can display the full 32 bit range of both signed and unsigned numbers.
dtInt The number is rounded to the nearest integer and displayed as a decimal string. The property Precision has no meaning for this selection.
dtOct The number is rounded to the nearest integer and displayed as a octal string. The number of digits is defined by the property Precision.
dtState The control does not display a numeric value but the text specified by the property StateText. This display type allows the user to display short texts (i.e. for indicating special conditions).
dtZeroInt The number is rounded to the nearest integer and displayed as a decimal string with leading zeroes. The number of digits is defined by the property Precision.

The screen copy below shows the outputs for some of the available DisplayType values using the number 44.6 with the property Precision set to 4.


Hint: In the Light Edition only the following formats are available: dtFloat, dtFixP, dtInt, and dtExp.

Example: This property is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): numlabel



Last Update: 2023-Dec-13