Public Function RoundToLarger(dblInput As Double, intDecimals As Integer) As Double
'执行Round()函数,有可能进位
'也有可能舍去
Dim strFormatString As String '格式化字符串
'如果是“0”,则返回“0”,否则进行适当的格式化:
If dblInput <> 0 Then
strFormatString = "#." & String(intDecimals, "#")
RoundToLarger = Format(dblInput, strFormatString)
Else
RoundToLarger = 0
End If
End Function
来 源 于:http://www.tek-tips.com/faqs.cfm?spid=705&rat1=10&sfid=3734