I think it would be better to call parseInt() just once and handle the possible number format exception