剑 剑指关7910 Unregistered / Unconfirmed GUEST, unregistred user! 2005-01-25 #1 问题是怎么取数,例子:23.1234,我想只留两位小数,不用四舍五入,完成后为23.12,请虾姐百忙中给予解决!!
剑 剑指关7910 Unregistered / Unconfirmed GUEST, unregistred user! 2005-01-25 #2 问题是怎么取数,例子:23.1234,我想只留两位小数,不用四舍五入,完成后为23.12,请虾姐百忙中给予解决!!
G gaojun_ang Unregistered / Unconfirmed GUEST, unregistred user! 2005-01-25 #3 看看这样行不行:<br>var Temp:string;<br> i:integer;<br>begin<br> Temp:=FloatToStr(31.245);<br> i:=Pos('.',Temp);//小数点位置<br> if i&gt;0 then<br> Temp:=Copy(Temp,1,i + 2);//保留小数点后两位<br> ShowMessage(Temp);<br>end;<br>
看看这样行不行:<br>var Temp:string;<br> i:integer;<br>begin<br> Temp:=FloatToStr(31.245);<br> i:=Pos('.',Temp);//小数点位置<br> if i&gt;0 then<br> Temp:=Copy(Temp,1,i + 2);//保留小数点后两位<br> ShowMessage(Temp);<br>end;<br>
M minglove Unregistered / Unconfirmed GUEST, unregistred user! 2005-01-25 #4 edit2.Text:= formatfloat('####.00',strtofloat(Edit1.Text));