Strange error comparing two Variables

So guys, i’m trying to compare two integer variables, and something very strange is happening, this is the code:

\*\*jAnswer\*\* -- is a variable set via jSON, the value can only be 0 or 1. local function checkAnswer(answer) if (answer == jAnswer ) then print("Correct Answer") print("Answer is = "..answer.." jAnswer = "..jAnswer) else print("Wrong Answer") print("Answer is = "..answer.." jAnswer = "..jAnswer) end end checkAnswer(1) -- Calling the Function Here

In my tests, i always get a output like this:

Wrong Answer

Answer is  = 1 jAnswer = 1

So they are apparently equal, what could possible the problem?

Try doing toNumber() on both, just in case…

nailed it!

Basically the jAnswer, was being interpreted as a String.

Try doing toNumber() on both, just in case…

nailed it!

Basically the jAnswer, was being interpreted as a String.