delphi4arab منتديات دلفي للعرب

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