K
kongkong
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
f1,F2,f3,F4 : DOUBLE;
D1,D2 : DOUBLE;
begin
D1 := 10.95;
D2 := 12.1;
//-------------------------------
F1 :=StrToFloat(FloatToStr(D1 * D2));
F2 := D1 * D2;
F3 := 132.495 ;
F4 := 10.95 * 12.1;
//----------------------------------
ShowMessage(FormatFloat('0.00',F1));//132.50
ShowMessage(FormatFloat('0.00',F2));//132.49
ShowMessage(FormatFloat('0.00',F3));//132.50
ShowMessage(FormatFloat('0.00',F4));//132.50
ShowMessage(FloatToStr(f1)+ ' '+ FloatToStr(f2)+ ' '+ FloatToStr(f3)+ ' '+FloatToStr(f4));
end;
var
f1,F2,f3,F4 : DOUBLE;
D1,D2 : DOUBLE;
begin
D1 := 10.95;
D2 := 12.1;
//-------------------------------
F1 :=StrToFloat(FloatToStr(D1 * D2));
F2 := D1 * D2;
F3 := 132.495 ;
F4 := 10.95 * 12.1;
//----------------------------------
ShowMessage(FormatFloat('0.00',F1));//132.50
ShowMessage(FormatFloat('0.00',F2));//132.49
ShowMessage(FormatFloat('0.00',F3));//132.50
ShowMessage(FormatFloat('0.00',F4));//132.50
ShowMessage(FloatToStr(f1)+ ' '+ FloatToStr(f2)+ ' '+ FloatToStr(f3)+ ' '+FloatToStr(f4));
end;