Show: Delphi C++
Display Preferences

System.SysUtils.TFloatFormat

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TFloatFormat = (ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency);

C++

enum DECLSPEC_DENUM TFloatFormat : unsigned char { ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency };

Properties

Type Visibility Source Unit Parent
enum public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

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

TFloatFormat defines an enumerated list of formatting codes for float functions.



Format Defines

ffGeneral

General number format. The value is converted to the shortest possible decimal string using scientific format. Trailing zeros are removed from the resulting string.

ffExponent

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 before the exponent 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).

ffFixed

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. The resulting values is padded with zeros when the Digits parameter is higher than the number of digits dictated by precision. For example, given ffFixed with Precision set to 5 and digits set to 3, fomatting 345.6789 gives the string '345.680', padding with zeros after the precision is met.

ffNumber

Number format. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The ffNumber format corresponds to the ffFixed format, except that the resulting string contains thousandth separators. The resulting value is padded with zeros when the Digits parameter is higher than the number of digits dictated by precision. For example, given ffNumber with Precision set to 5 and digits set to 3, fomatting 345.6789 gives the string '345.680', padding with zeros after the precision is met.

ffCurrency

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 Currency Format in the International section of the Windows Control Panel. The number of digits after the decimal point is given by the Digits parameter--it must be between 0 and 18. The resulting value is padded with zeros when the Digits parameter is higher than the number of digits dictated by precision. For example, given ffCurrency with Precision set to 5 and digits set to 3, fomatting 345.6789 gives the string '345.680', padding with zeros after the precision is met.



See Also

Personal tools
In Other Languages
Previous Versions
Assistance