EzGoingKev
Registered User.
- Local time
- Today, 06:10
- Joined
- Nov 8, 2019
- Messages
- 205
Good morning everyone.
I am using this VBA a google search provided:
I am getting inconsistent results when having it round up to two decimal points.
I am using the statement
2.849939 rounds up to 2.85. It is working how it is supposed to.
1.97 rounds up to 1.97. This is fine.
1.87 rounds up to 1.88. Not sure why it is doing this.
2.9 rounds up to 2.9. This is fine.
2.2 rounds up to 2.21. Not sure why it is doing this.
Can anyone help with this?
I am using this VBA a google search provided:
Code:
Public Function RoundUp(ByVal Num As Double, ByVal Decimals As Integer) As Double
Dim Factor As Double
Factor = 10 ^ Decimals
RoundUp = -Int(-Num * Factor) / Factor
End Function
I am getting inconsistent results when having it round up to two decimal points.
I am using the statement
Code:
RoundUp([MyFieldName], 2)
2.849939 rounds up to 2.85. It is working how it is supposed to.
1.97 rounds up to 1.97. This is fine.
1.87 rounds up to 1.88. Not sure why it is doing this.
2.9 rounds up to 2.9. This is fine.
2.2 rounds up to 2.21. Not sure why it is doing this.
Can anyone help with this?