System.AnsiStringBase.TStringFloatFormat

From RAD Studio API Documentation
Jump to: navigation, search

C++

enum TStringFloatFormat { sffGeneral, sffExponent, sffFixed, sffNumber, sffCurrency };

Properties

Type Visibility Source Unit Parent
enum public dstring.h System AnsiStringBase

Description

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

Format 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 (in the range from 0 through 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 (in the range from 0 through 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 in the range from 0 through 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 in the range from 0 through 18.

See Also