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....



Precision


Unit:SDL_numlab
Class:TNumLab
Declaration:property Precision: integer;

The Precision property determines the number of significant places used for the display of the numeric label. It may take any value between 0 and 15, with 2 being the default value. The Precision property has a slightly different meaning for the different types of available numeric formats :

dtFloat The numeric value is displayed with at least Precision significant digits. Any excess zeroes behind the decimal point are removed. A value below 2 is automatically limited to 2. The value is formatted in exponential notation if the number has more places than defined by Precision.
dtFixP A fixed number of Precision decimal places is used.
dtExp The number is displayed in exponential notation using Precision significant places. A value below 2 is automatically limited to 2.
dtEEng,
dtEEngNoDP
The number is displayed in electrical engineering notation using Precision significant places. A value below 1 is automatically limited to 1.
dtHex The number is rounded to the nearest integer and displayed as a hexadecimal string with Precision places (including leading zeroes). The hexadecimal string is truncated to Precision places, if the number is too large to fit into the given width (this is in contrast to dtZeroInt ). The maximum Precision for hexadecimal numbers is restricted to 8.
dtInt The number is rounded to the nearest integer and displayed as a decimal string. The property Precision has no meaning for this selection.
dtZeroInt The number is rounded to the nearest integer and displayed as a decimal string with leading zeroes. The number of places is defined by the property Precision. If the value exceeds the possible range given by Precision, the output string is enlarged in order not to truncate the number (this is in contrast to dtHex ).

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



Last Update: 2012-Oct-20