Wait...
Sorry, you are sending the numbers as ascii encoded. I just realised 48 = "0" and 52 = "4".
So parseInt was right. But I would still recommend checking available () >= 4.
Wait...
Sorry, you are sending the numbers as ascii encoded. I just realised 48 = "0" and 52 = "4".
So parseInt was right. But I would still recommend checking available () >= 4.