小问题,类型转换 怎么把DBEDIT3.text中的数字,如果小于0.5就取0.5,大于或等于就不变,最后转换成整数形式并显示出来。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try if StrToFloat(DBEdit3.Text)<0.5 then DBEdit3.Text := '0.5';exceptend; 转换成整数形式是什么意思?round()//四舍五入trunc()//取整 FormatFloat('0.00', 6.666);返回6.67 if StrToFloat(DBEdit3.Text)<0.5 then DBEdit3.Text := '0.5' else begin edit3.text:=inttostr(round(strtofloat(dbedit3.text));end; if StrToFloat(DBEdit3.Text)<0.5 then DBEdit3.Text := '0.5' else begin edit3.text:=inttostr(round(strtofloat(DBEdit3.text));end;应该没有问题吧!!!! 随机函数请教 大家好,我是初学的,麻烦大家帮忙看一下这段代码,说from子语句有问题 得到HBitmap如何存为文件? TreeView1的使用?? TreeView中选中节点的问题 想问已知道控件的Name,可以直接用吗? 我先给分了,大家帮忙阿! CORBA中的问题 怎样做像QQ一样的浮动窗体? 报表打印中,,我想使在subdetail中的每条子记录前加序号 怎样在安装程序中加入access2000的驱动阿? 怎樣用Delphi Code 實現 Access2000 Report 的 preview or print Action?
if StrToFloat(DBEdit3.Text)<0.5 then
DBEdit3.Text := '0.5';
except
end;
round()//四舍五入
trunc()//取整
返回6.67
if StrToFloat(DBEdit3.Text)<0.5 then
DBEdit3.Text := '0.5'
else begin
edit3.text:=inttostr(round(strtofloat(dbedit3.text));end;
DBEdit3.Text := '0.5'
else begin
edit3.text:=inttostr(round(strtofloat(DBEdit3.text));
end;
应该没有问题吧!!!!