My answer to most questions: roll your own, you'll be done faster :-)

function StripSeparators(s:string):string;
var i:Integer;
begin
  I := AnsiPos(',',s);
  While I <> 0 do
  Begin
    System.Delete(s,I,1);
    I := AnsiPos(',',s);
  End;
  Result := s;
end; 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of rinke hoekstra
> Sent: Saturday, March 25, 2006 12:23 AM
> To: [email protected]
> Subject: reading string numbers with thousand separators
> 
> Hi List,
> 
> In my app, I'm trying to read strings which should be converted to floats
> or integers.
> However, the strings contain thousand separators, and most build-in
> functions of delphi
> cannot seem to handle those (FloatToStr, Val, etc).
> 
> Of course I could build some routine with pos(...) etc stripping the
> thousand separators
> from the strings before passing them into a converting routine, but I
> cannot imagine that
> there isn't a simple delphi function which CAN handle thousand separators
> when trying
> to convert from strings to numbers.
> 
> which function am i overlooking?
> 
> thanks, Rinke
> 
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi



_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to