老程序员都知道,技巧在于活用类型转换,赞。
Function Round(ByVal nValue As Decimal, ByVal nDigits As Integer) As Decimal
Round = Int(nValue * (10 ^ nDigits) + 0.5) / (10 ^ nDigits)
End Function
老程序员都知道,技巧在于活用类型转换,赞。
Function Round(ByVal nValue As Decimal, ByVal nDigits As Integer) As Decimal
Round = Int(nValue * (10 ^ nDigits) + 0.5) / (10 ^ nDigits)
End Function