|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....|
|Home BasePack Stringl Procedures and Functions strff|
|See also: MakeEFormat, FormatData, ScanFPNum, BoolToStr, strffForcePlus, SigDigStr, AutoFormatData|
The Delphi procedure str converts a numeric value to a character string. The use of this procedure is somewhat inconvenient since it involves a separately declared (auxiliary) variable. The function strff provides a remedy to this problem and returns a string of the value r. The field width and the number of decimal places are set by the values of the parameters FieldWidth and DecP.
The absolute (positive) value of FieldWidth determines the length of the resulting string, with the numeric characters being aligned to the right within that string. Leading blanks are replaced by zeroes if FieldWidth is negative.
The parameter DecP may take any value between -2 and 18. Values beyond this range are ignored. If DecP takes a negative value, a string using exponential notation is created. For DecP = -2 a special conversion mode is activated which ensures to output only 2 digits for the exponent. In this case a possible overflow of the output format (i.e. for exponents larger than 99) is indicated by creating a string which consists of all asterixes.
Note: The function strff replaces the old function strf of unit MATH1. While strf is still available in MATH1 (for compatibility reasons) it is no longer supported. You should thus use strff for future developments.