access 的四舍五入自定义函数谁有?我要好的

来源:百度知道 编辑:UC知道 时间:2024/07/02 11:50:01
效果要与excel中的round函数一样。5以上的全部入,4以下的舍。

Public Function RoundToLarger(dblInput As Double, intDecimals As Integer) As Double
Dim strFormatString As String
If dblInput <> 0 Then
strFormatString = "#." & String(intDecimals, "#")
RoundToLarger = Format(dblInput, strFormatString)
Else
RoundToLarger = 0
End If
End Function "注意模块名要改为'round'