عدم السماح بادخال اكثر من رقمين بعد الفاصلة
#11
كود :
http://www.delphibasics.co.uk/RTL.asp?Name=FloatToStrF
الرد
#12
كود :
procedure TForm1.advdtDailyRateChange(Sender: TObject);
begin
      advdtDailyRate.AutoThousandSeparator:=True;
end;
الرد
#13
Result
6,456,453,453,453,535
الرد
#14
كود :
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;
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم