I have tried these three things.
Dim Var as Double
Var = 9
Me.text1 = Round(Var / 5, 0)
Me.text1 = Round(Var / 5, 0) -1
Me.text1 = FormatNumber(Var / 5, 0)
Me.text1 = CInt(Var / 5)
All of these return the number 2 to Me.text1 except for the second which fails on Var = multiples of 5. I expected the third to work because 9/5 = 1.8, format the number to 0 decimal places and you get 1 but I guess Microsoft uses different logic then I do.
Is there a way to round down in VB or does everything Round up? I have
Basically I have a program where 0 to 4 = 0, 5 to 9 = 1, 10 to 14 = 2, etc... So I need to round down.
Thanks
-cm
Dim Var as Double
Var = 9
Me.text1 = Round(Var / 5, 0)
Me.text1 = Round(Var / 5, 0) -1
Me.text1 = FormatNumber(Var / 5, 0)
Me.text1 = CInt(Var / 5)
All of these return the number 2 to Me.text1 except for the second which fails on Var = multiples of 5. I expected the third to work because 9/5 = 1.8, format the number to 0 decimal places and you get 1 but I guess Microsoft uses different logic then I do.
Basically I have a program where 0 to 4 = 0, 5 to 9 = 1, 10 to 14 = 2, etc... So I need to round down.
Thanks
-cm