Private Sub Form_Load()
MsgBox SSWR("1.123456", 6)
End Sub
Function SSWR(x As String, n As Integer) As Double
If Mid(x, InStr(x, ".") + n, 1) >= 5 Then
x = Left(x, InStr(x, ".") + n - 1) + (1 / (1 * 10 ^ (n - 1)))
Else
x = Left(x, InStr(x, ".") + n)
End If
SSWR = x
End Function
函数没返回值