Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Dot versus comma in string representation of a float
This article has not been rated yet. After reading, feel free to leave comments and rate it.
Question:
Normally FloatToStr gives local decimal separator. (From System settings) How can I convert a float to a string with decimal dot and no separators?
Answer:
Use the Str() function instead of FloatToStr(), e.g.  | |  | | var
fMyFload : float;
sMyString : string;
begin
Str(fMyFloat:10:5, sMyString);
end; | |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|