Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function FormatFloat(const Format: string; Value: Extended): string; overload;
function FormatFloat(const Format: string; Value: Extended; const FormatSettings: TFormatSettings): string; overload;
Returns a string from a floating point value using the provided format string.
The second form of FormatFloat, refers to localization information contained in the FormatSettings parameter.
Format specifiers supported in the format string are:
0 Digit place holder.
# Digit placeholder.
. Decimal point.
, Thousand separator.
E+ Scientific notation.
'xx'/"xx" Characters enclosed in single or double quotes are output as-is.
; Separates sections for positive, negative, and zero numbers in the format string.
const AValue = 98765432.1;
FormatFloat('0',AValue);
// '98765432'
FormatFloat('###,###,###.0000',AValue);
// '98.765.432,1000'
FormatFloat('"Number" #.00',AValue);
// 'Number 98765432,10'
FormatFloat(',.00',AValue);
// '98.765.432,10'
|
TFormatSettings,
FloatToStrF,
FloatToStr,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|