DelphiFAQ Home Search:
General :: Programming :: Delphi :: Strings
Algorithms for string handling problems, implemented in Delphi but useful for any procedural language.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Dot versus comma in string representation of a float

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!
Generated 0:01:34 on Apr 23, 2017