只能变通一下了
Local $iRound1 = RoundX(2.154, 2)
Local $iRound2 = RoundX(2.155, 2)
Local $iRound3 = RoundX(8.154, 2)
Local $iRound4 = RoundX(8.155, 2)
MsgBox(4096, "", "The following values were rounded: " & @CRLF & '2.154==>'&$iRound1 & @CRLF &'2.155==>'&$iRound2 & @CRLF &'8.154==>'&$iRound3 & @CRLF &'8.155==>'&$iRound4)
Func roundx($number, $num_digits)
$number=Int($number*10^($num_digits+1))
If StringRight($number,1)<5 Then
$number=Int($number/10)/10^$num_digits
Else
$number=Int($number/10+1)/10^$num_digits
EndIf
Return $number
EndFunc
|