то все способы преобразовать плавучку в строку дают возможность указать нужное число цифр
это вот интересный вопрос )
Это не я. И разбираться не хочу зачем такой валидатор. По крупному работаю ))) procedure TTreeAltPrz.Validate(Sender: TObject; var ErrorText: String; var Accept: Boolean); var Editor_:TdxInplaceEdit; Fmt_,AllowTip_:Integer;AllowVal_:String; begin Accept:=False; Editor_:=Tree.InplaceEditor; if Editor_=nil then exit; Fmt_:=Query.FieldByName('Fmt').AsInteger; AllowTip_:=Query.FieldByName('AllowTip').AsInteger; AllowVal_:=Query.FieldByName('AllowVal').AsString; if not(Fmt_ in [Ord(opfUsrRef),Ord(opfNumeric)]) then exit; if(Fmt_=Ord(opfUsrRef)) then begin Accept:=ValidateRef(Editor_.GetEditingText,Sender) end else begin case AllowTip_ of eqList :Accept:=ValidateList(Editor_.GetEditingText,Sender); eqDiapazon:Accept:=ValidateDiapazon(Editor_,AllowVal_); else begin Accept:=IsValidFloat(Editor_.GetEditingText); if not Accept then exit; Editor_.SetEditingText(FloatToStr(FloatRound(Query.FieldByName('Precis').AsInteger, True,StToFloat(Editor_.GetEditingText,FormatSettings.DecimalSeparator)))); end; end; end; if Accept then begin FSaved:=False; DoChanged; end; end;
Обсуждают сегодня