float可不可以转换为integer??how??
或者delphi取整函数有没有?
或者delphi取整函数有没有?
解决方案 »
- delphi webb中 按钮点击的问题
- 透明的Panel控件
- dbgrid显示数据时的怪问题
- 小BUG,高手请进-------------关于DBGrid导出WORD代码------------------(可收藏)
- 送分问题!请问怎样模拟Alt+F4按键,最好能给出一个通式!分不够在加!
- 谁有可用分啊?给点 555555555555
- 谁有delphi写的通用进销存
- SQL语句中的路径"库名.表名"中,库名是怎样规定的?
- 无知的问题:好的多层的客户端程序一般是什么样儿的?
- 急救!关于Delphi + MediaPlayer 的兼容性问题。
- 如何使用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)