المشاركات : 418
المواضيع 50
:
: 0
الإنتساب : Sep 2009
كود :
http://www.delphibasics.co.uk/RTL.asp?Name=FloatToStrF
المشاركات : 418
المواضيع 50
:
: 0
الإنتساب : Sep 2009
كود :
procedure TForm1.advdtDailyRateChange(Sender: TObject);
begin
advdtDailyRate.AutoThousandSeparator:=True;
end;
المشاركات : 418
المواضيع 50
:
: 0
الإنتساب : Sep 2009
Result
6,456,453,453,453,535
المشاركات : 418
المواضيع 50
:
: 0
الإنتساب : Sep 2009
كود :
procedure TAdvEdit.AutoSeparators;
var
s, si, neg: string;
d: Double;
Diffl, OldSelStart, OldPrec: Integer;
begin
s := self.Text;
Diffl := Length(s);
OldSelStart := 0;
if HandleAllocated then
OldSelStart := SelStart;
if (s = '') then
Exit;
if (Pos('-', s) = 1) then
begin
Delete(s, 1, 1);
neg := '-';
end
else
neg := '';
if (Pos(DecimalSeparator, s) > 0) then
s := Copy(s, Pos(DecimalSeparator, s), 255)
else
s := '';
d := Trunc(Abs(self.FloatValue));
if FAutoThousandSeparator then
si := Format('%n', [d])
else
si := Format('%f', [d]);
si := Copy(si, 1, Pos(decimalseparator, si) - 1);
OldPrec := FPrecision;
FPrecision := 0;
//changed 1.8
FBlockChange := (Text <> FPrefix + neg + si + s + FSuffix);
inherited Text := FPrefix + neg + si + s + fSuffix;
FBlockChange := false;
FPrecision := OldPrec;
Diffl := Length(self.Text) - Diffl;
if HandleAllocated then
begin
SelStart := OldSelStart + Diffl;
SelLength := 0;
end;
end;