Hi everyone, I was wondering how to find if a number is even/odd but with a slight twist...
I have the code build in to determine so it sets the number to a variable then runs the following.
Dim i as Integer
If i Mod 2 Then
MsgBox "Number is Odd"
Else
MsgBox "Number is Even"
End If
The twist I am trying to incorporate is finding if the number including the decimals are odd/even. So for example 5.19 I would want to prompt as odd and 5.20 I would want to prompt as even...
Is there a way to do this? After trying a few things it only round up or down to the base number and says odd and even for that number only. Would I need to develop a work around so it only grabs the last two numbers?
The reason I haven't already done this is because I am finding out if a in script calculated value is even/odd so that value doesn't exist on my screen.
Thanks for any insight!
I have the code build in to determine so it sets the number to a variable then runs the following.
Dim i as Integer
If i Mod 2 Then
MsgBox "Number is Odd"
Else
MsgBox "Number is Even"
End If
The twist I am trying to incorporate is finding if the number including the decimals are odd/even. So for example 5.19 I would want to prompt as odd and 5.20 I would want to prompt as even...
Is there a way to do this? After trying a few things it only round up or down to the base number and says odd and even for that number only. Would I need to develop a work around so it only grabs the last two numbers?
The reason I haven't already done this is because I am finding out if a in script calculated value is even/odd so that value doesn't exist on my screen.
Thanks for any insight!