I dont no in english if odd number is the right word but i want to make all my number to 1, 3, 5, 7, 9, etc,....
Thanks for your help 🙂
Hi sergelachance,
I'm not exactly sure what numbers you are trying to change?
And yes, Odd Numbers is the correct way of saying this.
Regards
Mitch
Hi sergelachance,
Please use a translator to understand, or what language do you speak?
I am asking a question about what numbers you are making odd.
Regards
Mitch
Sorry for my horrible english, i'm french Canadian 🙂
I just want to change with ilogic when my parameters number is even same to 0,2,4,6,8,etc,... change to odd number same to 1,3,5,7,9,etc,.... what is a right rule for that???
Thanks again!
Hi sergelachance,
This is a simple rule that will check for what you have asked. I'm not sure of your true application, but for a single parameter this should work.
The code is dividing the parameter by 2, if the remainder is not 0 (ie. it is not divisible by 2 into a whole number), the code will add 1 to the parameter.
------------- Code ----------------------
If (Parameter("PARAMETER_NAME_HERE") Mod 2) <> 0 Then
Parameter("PARAMETER_NAME_HERE") = Parameter("PARAMETER_NAME_HERE") + 1
End If
--------------------------------------------
Regards
Mitch
Let me know if it helps.... Kudos if it works!!!
Hi sergelachance,
I'm not quite sure I understnad what the problem is. The code I provided adds 1 to an even number in order to make it odd. You could also MINUS 1 if you'd like in order to achieve an odd number as well.
What confuses me with your code is that you have 2 different parameters being used.
Why is it:
("TROUSTAB" Mod 2) = 0 Then
"QTETROUSTAB" = "TROUSTAB" + 1
Shouldn't it be:
("TROUSTAB" Mod 2) = 0 Then
"TROUSTAB" = "TROUSTAB" + 1
Regards
Mitch
Let me know if it helps... Kudos if it works!!!
Sergelachance,
That was NOT a new rule, you must keep the OLD rule but replace the parameter name
If (Parameter("TROUSTAB") Mod 2) = 0 Then
Parameter("TROUSTAB") = Parameter("TROUSTAB") + 1
End If