[image of digits]

Delphi Basics

UK Delphi Basics

 

FORMATTING

FloatToStrF() - Convert a floating point number to a formatted string.
Information extracted from UK Delphi Basics.

Fixed
FloatToStrF(1234.567, ffFixed, 8, 4); 1234.5670
FloatToStrF(1234.567, ffFixed, 4, 4); 1235.0000
FloatToStrF(1234.567, ffFixed, 4, 2); 1235.00
FloatToStrF(1234.567, ffFixed, 2, 4); 1.2E0003
General
FloatToStrF(1234.567, ffGeneral, 8, 4); 1234.567
FloatToStrF(1234.567, ffGeneral, 4, 4); 1235
FloatToStrF(1234.567, ffGeneral, 4, 2); 1235
FloatToStrF(1234.567, ffGeneral, 2, 4); 1.2E0003
Number
FloatToStrF(1234.567, ffNumber, 8, 4); 1,234.5670
FloatToStrF(1234.567, ffNumber, 4, 4); 1,235.0000
FloatToStrF(1234.567, ffNumber, 4, 2); 1,235.00
FloatToStrF(1234.567, ffNumber, 2, 4); 1.2E0003
Currency CurrencyString := '$';
FloatToStrF(1234.567, ffCurrency, 8, 4); $1,234.5670
FloatToStrF(1234.567, ffCurrency, 4, 4); $1,235.0000
FloatToStrF(1234.567, ffCurrency, 4, 2); $1,235.00
FloatToStrF(1234.567, ffCurrency, 2, 4); 1.2E0003
Exponent
FloatToStrF(1234.567, ffExponent, 8, 4); 1.2345670E+0003
FloatToStrF(1234.567, ffExponent, 4, 4); 1.235E+0003
FloatToStrF(1234.567, ffExponent, 4, 2); 1.235E+03
FloatToStrF(1234.567, ffExponent, 2, 4); 1.2E+0003