 # If Condition with Digit

Hi,

I have a digit for example “5” and I need to do the following steps:

If x = ((1x72) or (2x72) or (3x72) or (4x72) or (5x72)):
** then Do action**

So I was thinking first I need to break the digit like this - 5: {1,2,3,4,5}
Then do the above If condition.

Is there a simpler way to do this?

P.S. It will not always be 5. It can be 6 ,7 , … But I need to check if x is a multiple of 72.

Thanks!

To start with you can use the digits in Enumerable.Range and Code in the For Each(Should be Int Argument) For Each iteration , you multiply that value into 72 and do the check…

Hi!

Yes! You can use the Mod Operator !! Mod Operator - Visual Basic | Microsoft Docs

It returns the remainder of a divison. If it is 0, your VariableX is a multiple of your SampleNumber (72).
Example: `VariableX (3024) Mod SampleNumber (72)` returns 0! Your VariableX is a multiple of your SampleNumber. If that is the case, you can choose to get the division result (digit) by using quick maths!

Happy automating

1 Like