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



AutoFormatData


Unit:SDL_stringl
Class: None
Declaration: function AutoFormatData (data: double; SigDig: integer): string;

The function AutoFormatData converts the parameter data to a string using a representation according to the following guidelines: (1) if the absolute value is greater than 10SigDig-1 or less than 0.1 the value is converted to exponential notation. (2) Numbers between those two boundaries are converted using a floating point representation. (3) The number of decimal places is adjusted in a way that SigDig significant digits are used. Any additional digits are rounded off.

Examples:
Value SigDig formatted string
0
1
-0.1
-18.87126591
8E3
77.21
9826712871
4
3
8
8
7
6
4
0.000
1.00
-1.0000000E-01
-18.871266
8000.000
77.2100
9.827+09
     



Last Update: 2013-Dec-07