N no1 Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #1 delphi 怎样可以直接float to integer(1234.456 ->1234 )? floattodicemal(,,,,)行吗?怎么用(for example)?
Z zgdtxf Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #2 1.可以用int(1234.456)=1234 2.floattodicemal(,,,,)不行,还是有小数点的
Y yansh Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #4 var R: Real; begin R := Int(123.456); { 123.0 } R := Int(-123.456); { -123.0 } end;
S simbasun Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #5 m : float; n : integer; m := 1234.56; n := integer(m);
X xinglong Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #7 StrToInt(Format('%4.0f',[1234.456]))
B bbkxjy Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #8 var i: Integer; j: double; begin j:= 1234.567; i := Trunc(j); end;
D denglb Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-20 #9 是否要求四舍五入,一般来说Round()是最好的解决方法