Delphi FormatFloat
Не могу разобраться с функцией FormanFloat вот кусочек кода
procedure TMainForm.OKClick(Sender: TObject);
var
x,y,z:Real;
begin
x:=StrToFloat(Edit1.Tex);
y:=StrToFloat(edit2.Tex);
z:=x/y;
Edit3.Tex:=FloatToStr(z); / Как пременить FormatFloat(' #.##') к Edit3.Tex
А что именно сделать то надо?
Edit3.Text:=FormatFloat(' #.##',z)
или
FormatFloat(' #.##',StrToFloat(Edit3.Text))
// Set up our floating point number
float := 1234.567;
// Display a sample value using all of the format options
// Round out the decimal value
ShowMessage('##### : '+FormatFloat('#####', float));
ShowMessage('00000 : '+FormatFloat('00000', float));
ShowMessage('0 : '+FormatFloat('0' , float));
ShowMessage('#,##0 : '+FormatFloat('#,##0', float));
ShowMessage(',0 : '+FormatFloat(',0' , float));
ShowMessage('');
// Include the decimal value
ShowMessage('0.#### : '+FormatFloat('0.####', float));
ShowMessage('0.0000 : '+FormatFloat('0.0000', float));
ShowMessage('');
// Scientific format
ShowMessage('0.0000000E+00 : '+FormatFloat('0.0000000E+00', float));
ShowMessage('0.0000000E-00 : '+FormatFloat('0.0000000E-00', float));
ShowMessage('#.#######E-## : '+FormatFloat('#.#######E-##', float));
ShowMessage('');
// Include freeform text
ShowMessage('"Value = "0.0 : '+FormatFloat('"Value = "0.0', float));
ShowMessage('');
// Different formatting for negative numbers
ShowMessage('0.0 : '+FormatFloat('0.0' , -1234.567));
ShowMessage('0.0 "CR";0.0 "DB" : '+
FormatFloat('0.0 "CR";0.0 "DB"', -1234.567));
ShowMessage('0.0 "CR";0.0 "DB" : '+
FormatFloat('0.0 "CR";0.0 "DB"', 1234.567));
ShowMessage('');
// Different format for zero value
ShowMessage('0.0 : '+FormatFloat('0.0' , 0.0));
ShowMessage('0.0;-0.0;"Nothing" : '+
FormatFloat('0.0;-0.0;"Nothing"', 0.0));