Division of two variables returns zero

I’m not sure where I am going wrong with a simple division of two variables.
Right now I have:

  • Two Get Full Text activities
  • Assignments which remove the text via regex inside a CInt
  • Another assignment that takes the two variables and divides to calculate the percentage.
  • Finally a message box

When this executes, the value in the message box is 0.
Please advise.

board.html (12.8 KB) Main.xaml (9.4 KB)

@ay0ung
eLicPercent is of type Int32 which means that it can’t hold fractional values.Int types can only hold integers: 1, 2, 3, etc… Change it to type Double and it should have the correct value.

1 Like

Thank you for the quick response and this information. I believe I set the variable to the correct type. I browsed and selected System.Double, from mscorlib. However, I still get a result of 0.

@ay0ung
Can you log your two integer values right before you divide them to make sure that they are the value that you expect?

Edit
Also switch your eLicOffered and eLicAnswered types to Int32, the GenericValue data type has the same problem where it cuts down to an integer if possible. (In general I recommend the practice of using GenericValue as little as possible.)

1 Like