float可不可以转换为integer??how??
或者delphi取整函数有没有?
或者delphi取整函数有没有?
解决方案 »
- 学写服务,启动不了
- 散分,庆祝小黑成功瘦了2斤 -_-!
- 异常处理结构(却不行)
- 控件问题
- 我昨天第一次用ADO,我感觉他和ODBC差不多,你觉得呢?
- 哪位大侠有关于tms charts 的例子
- 服务器启动时提示[dbnmpntw]ConnectionOpen(CreateFile())????
- 有谁知道12月28号的上海人才招聘会情况?(提供线索即给分)
- 请问各位高手:D5中自带的IBLocal数据库如何打开?UserName: SYSDBA ;Password : ??????
- 哪有WEB程序调试工具IntraBob下载??
- 如何使用ADO直接访问Excel数据文件?
- delphi7的报表工具怎么用?
S := T + ' rounds to ' + IntToStr(Round(1.4)) + #13#10;
Str(1.5:2:1, T);
S := S + T + ' rounds to ' + IntToStr(Round(1.5)) + #13#10;
Str(-1.4:2:1, T);
S := S + T + ' rounds to ' + IntToStr(Round(-1.4)) + #13#10;
Str(-1.5:2:1, T);
S := S + T + ' rounds to ' + IntToStr(Round(-1.5));
MessageDlg(S, mtInformation, [mbOk], 0, mbOk);
end;
begin
Str(1.4:2:1, T);
S := T + ' Truncs to ' + IntToStr(Trunc(1.4)) + #13#10;
Str(1.5:2:1, T);
S := S + T + ' Truncs to ' + IntToStr(Trunc(1.5)) + #13#10;
Str(-1.4:2:1, T);
S := S + T + ' Truncs to ' + IntToStr(Trunc(-1.4)) + #13#10;
Str(-1.5:2:1, T);
S := S + T + ' Truncs to ' + IntToStr(Trunc(-1.5));
MessageDlg(S, mtInformation, [mbOk], 0, mbOk);
end;
showmessage(inttostr(trunc(7.89)));
trunc是取整
round是四舍五入取整
即:XXXX(3.1223)=4
else int_x:=trunc(float_x-0.0005)