Private Sub RoundToDigitsVerify() ' Test the RoundToDigits function. Debug.Assert RoundToDigits(1.9) = 2 Debug.Assert RoundToDigits(1.5) = 2 Debug.Assert RoundToDigits(1.1) = 1 Debug.Assert RoundToDigits(1) = 1 Debug.Assert RoundToDigits(0.9) = 1 Debug.Assert RoundToDigits(0.5) = 1 Debug.Assert RoundToDigits(0.1) = 0 Debug.Assert RoundToDigits(0) = 0 Debug.Assert RoundToDigits(-0.1) = 0 Debug.Assert RoundToDigits(-0.5) = 0 Debug.Assert RoundToDigits(-0.9) = -1 Debug.Assert RoundToDigits(-1) = -1 Debug.Assert RoundToDigits(-1.1) = -1 Debug.Assert RoundToDigits(-1.5) = -1 Debug.Assert RoundToDigits(-1.9) = -2 Debug.Assert RoundToDigits(1.27, 1) = 1.3 Debug.Assert RoundToDigits(1.23, 1) = 1.2 Debug.Assert RoundToDigits(123456, -1) = 123460 Debug.Assert RoundToDigits(123456, -3) = 123000 Debug.Assert IsNull(RoundToDigits(Null, 3)) Debug.Assert IsNull(RoundToDigits("Joe", 3)) Debug.Assert RoundToDigits(1.1, Null) = 1 Debug.Assert RoundToDigits(1.1, "Joe") = 1 End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.