The problem is that you're parsing the whole string (including the plus). For example, "123+" is not a number, and Java is telling you that. What you could do is remove that last character, then...