| Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back |
Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
FloatToStrF |
unit |
| SysUtils | |
| category | |
| Floating point conversion routines |
| declaration |
function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer; const FormatSettings: TFormatSettings): string; overload;
| description |
FloatToStrF converts the given floating-point value to its string representation. The conversion uses Precision and Digits parameters to control how the value is formatted into a string. Details are specified using the TFloatFormat parameter.
The second form of FloatToStr, refers to localization information contained in the FormatSettings parameter.
| example |
var PI1000 : extended; PI1000 := PI * 1000; // 3141592.6535897932385 FloatToStrF(pi1000,ffGeneral,12,2); // '3141.59265359' FloatToStrF(pi1000,ffExponent,12,2); // '3.14159265359E+03' FloatToStrF(pi1000,ffFixed,12,2); // '3141.59' FloatToStrF(pi1000,ffNumber,12,2); // '3,141.59' FloatToStrF(pi1000,ffCurrency,12,2); // '3,141.59 kn' (kn is currency symbol in Croatia) |
| in real code |
| see also |
| Free Delphi code snippet inside every Delphi Newsletter! |
|
|
| Got some code to share? Got a question? Need some help? |
|
|

