SigDigStr

Declaration: SigDigStr(Data: real; Width, NSigDig: integer; NoBlanks: boolean): string;
The function SigDigStr converts the numerical value Data1) into a string of length Width showing NSigDig significant digits. (Note the difference between number of decimal places and number of significant digits).

The parameter NoBlanks suppresses any leading blanks if set to TRUE. Please note that, for example, SigDigStr(xx,8,4,true) is not the same as SigDigStr(xx,1,4,false). Following are the results for different parameters (assuming that xx = 23.12345, the resulting blanks are indicated by the tilde sign ~):

SigDigStr(xx,8,4,true)
23.12
SigDigStr(xx,8,4,false)
~~~23.12
SigDigStr(xx,1,4,true)
2.312E+01
SigDigStr(xx,1,4,false)
~2.312E+01

Hint: The number of significant digits is not restricted if data is greater than 10NSigSig.




1) Please note that the data type "real" is a placeholder and means either "single", "double", or "extended" depending on the declaration of the involved variables.