
18.07.2008, 00:29
|
|
Участник форума
Регистрация: 10.01.2007
Сообщений: 140
С нами:
10175096
Репутация:
105
|
|
Сообщение от z01b
увы ты ощибаешся, такой ф-ции - нету и не может быть. Для выполнения задачи ТС нужно использовать floattostr strtofloat ...
Добавлено
Такой ф-ций нету в стандартной Sysutils.dcu
Да не, просто парень напутал, на самом деле есть старая паскалевская процедура Str в модуле System.dcu, вот собсна из справки самой делфи:
Код:
Delphi syntax:
procedure Str(X [: Width [: Decimals ]]; var S);
Description
In Delphi code, Str converts X to a string representation
according to the Width and Decimals formatting
parameters. The effect is like a call to Write except the
resulting string is stored in S instead of being written to
a text file.
X is an integer-type or real-type expression. Width and
Decimals are integer-type expressions. S is a string-type
variable or a zero-based character array variable if
extended syntax is enabled.
а вот StrToReal действительно я не знаю, это FloatToStr нада юзать.
Taktik, делай так:
Код:
procedure TForm1.Button1Click(Sender: TObject);
begin
e:=StrToFloat(Edit1.Text);
p:=StrToFloat(Edit2.Text);
sum:=e+p;
Str(sum:3, x);// отображает три символа после плавающей запятой
Edit3.Text := x;
end;
Последний раз редактировалось t04; 18.07.2008 в 00:35..
|
|
|