Well the input is a string before you convert it back into a number. Why not use a String method to manipulate it just after input?

One of the methods in this link to the Java API should do the...