C Cowry Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-11 #2 var MyExtend: Extended; MyInt: Integer; begin MyExtend:=234234.23423423; MyInt:= StrtoInt(FormatFloat('0',MyExtend)); end; 结果:MyInt=234234, 符合要求吗?
var MyExtend: Extended; MyInt: Integer; begin MyExtend:=234234.23423423; MyInt:= StrtoInt(FormatFloat('0',MyExtend)); end; 结果:MyInt=234234, 符合要求吗?
P peng_qs Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-11 #4 1. StrToInt(FloatToStrF(234234.234234,ffGeneral,6,0)); 2. Round(234234.234234); 3. Trunc(234234.234234);
1. StrToInt(FloatToStrF(234234.234234,ffGeneral,6,0)); 2. Round(234234.234234); 3. Trunc(234234.234234);
O only you Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-11 #5 以上的转换都会造成数据被截断! 建议你用Integer数组来进行分别保存整数和小数部分