Is there a function to reverse FloatToStrF? By that I mean go back from currency money format to string format. For example:

Edit1.Text := FloatToStrF(10000, ffCurrency, 15, 4);

The result

Edit1.Text = '$10,000.0000'

I'm wondering if there is somthing like StrToFloatF so

Edit1.Text = '10000';

thank's

有帮助吗?

解决方案

How about:

function RemoveAnythingButNumbers(aString: string): string;
var
  C: Char;
begin
  Result := '';
  for C in aString do
  begin
    if C in ['0'..'9'] then Result := Result + C;
  end;
end;

Note that I corrected the set of numbers.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top