Not sure what the issue with is: it threw a huge error: int nDollars = Integer.parseInt(sDollars); I have hence commented it out and used the string sDollars to display n.