Hi, I am trying to find out how to get the value(integer or float) of the division I made on the variable, something like this:
var num1 = 20;
var num2 = 10;
function Update(){
var checkint = num1/num2;//checkint = 10
if(/*checkint.value == int*/){//this is what I need to know
DoSomething();
}
}
as you can see in this case checkint would be an int so it would do something else, but if lets say, num1 is 22,so the division would end in float(2.2) so it would not pass the if.
Eric5h5 code works but I believe it could break if you change the variables' values.
I'm not 100% certain what you're trying to achieve but if you're just making sure a number is a int(round number) and not a float. you could always compare the trueValue with a roundValue.
Something like: