RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System::AnsiStringBase::TStringFloatFormat Enumeration

System::AnsiStringBase::TStringFloatFormat is an enumerated list of formatting codes for float functions.

Pascal
TStringFloatFormat = (
  sffGeneral,
  sffExponent,
  sffFixed,
  sffNumber,
  sffCurrency
);
C++
enum TStringFloatFormat {
  sffGeneral,
  sffExponent,
  sffFixed,
  sffNumber,
  sffCurrency
};

System::AnsiStringBase::TStringFloatFormat defines an enumerated list of formatting codes for the float functions.

Defines 
sffGeneral  
General number format. The value is converted to the shortest possible decimal string using fixed or scientific format. Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format, and the digits parameter specifies the minimum number of digits in the exponent (between 0 and 4).  
sffExponent  
Scientific format. The value is converted to a string of the form "-d.ddd...E+dddd". The resulting string starts with a minus sign if the number is negative, and one digit always precedes the decimal point. The total number of digits in the resulting string (including the one before the decimal point) is given by the precision parameter. The "E" exponent character in the resulting string is always followed by a plus or minus sign and up to four digits. The digits parameter specifies the minimum number of digits in the exponent (between 0 and 4).  
sffFixed  
Fixed point format. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative, and at least one digit always precedes the decimal point. The number of digits after the decimal point is given by the digits parameter--it must be between 0 and 18. If the number of digits to the left of the decimal point is greater than the specified precision, the resulting value will use scientific format.  
sffNumber  
Number format. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The sffNumber format corresponds to the sffFixed format, except that the resulting string contains thousand separators.  
sffCurrency  
Currency format. The value is converted to a string that represents a currency amount. The conversion is controlled by the CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator, and DecimalSeparator global variables, all of which are initialized from the Currency Format in the International section of the Windows Control Panels. The number of digits after the decimal point is given by the Digits parameter--it must be between 0 and 18.  

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!