A aolong79 Unregistered / Unconfirmed GUEST, unregistred user! 2003-04-14 #1 我想将‘1456.7567’取小数点后两位得到‘1456.75’或者得到‘1456.76’怎么做啊?如果是‘1.456E-3’取小数点后两位,怎么做啊?谁能给我个解答阿?谢谢!!!!
L LeeChange Unregistered / Unconfirmed GUEST, unregistred user! 2003-04-14 #2 Round(1456.7567*100)/100
H HunterTeam Unregistered / Unconfirmed GUEST, unregistred user! 2003-04-14 #3 得到1456.75,用trunc(1456.7567*100)/100 //trunc朝0取整<br>得到1456.76,用round(1456.7567*100)/100 //round四舍五入<br>
得到1456.75,用trunc(1456.7567*100)/100 //trunc朝0取整<br>得到1456.76,用round(1456.7567*100)/100 //round四舍五入<br>
C cchenl Unregistered / Unconfirmed GUEST, unregistred user! 2003-04-14 #6 floattostr(Strtofloat(FormatFloat('0.'+StringOfChar('0',2),strtofloat('1456.7567'))));