(C#) Figure out when a number (int) reaches every tens

Hello all, I am sorry for my poorly formulated topic.

Anyhow, I am trying to figure out how to “calculate” when a number hits 10, 20, 30, 40 etc.
And it must be a simpler and more clever way to do this instead of saying:

If (ComboMultiplier == 10){
DoSomething1();
}

If (ComboMultiplier == 20){
DoSomething2();
}

If (ComboMultiplier == 30){
DoSomething3();
}

The ComboMultiplier adds a number (combomultiplier += 1) when you do a successful attack on a enemy.
And I want the combo number flash on the screen every 10th successful attacks in a row. (I have a working code for the combomultiplier, so don’t you worry about that :slight_smile: )

In advance, thanks!
Simon

Instead of doing it, you can do it this way:

if(ComboMultiplier % 10 == 0){
     // This means that ComboMultiplier is multiplier of 10 (10, 60, 250, 125360)...
}

if you’d like to know how many 10s there are, it’s this way:

int multiplier = ComboMultiplier / 10;
// This will give you how many 10s there are ( 10 -> 1, 60 -> 6, 250 -> 25, 125360 -> 12536)

So, you can do this:

if (ComboMultiplier % 10 == 0){
     switch( ComboMultiplier / 10) {
     case 1:
          DoSomething1();
          break;
     case 2:
          DoSomething2();
          break;
     case 3:
          DoSomething3();
          break;
     }
}

Hope this helps :slight_smile: