How in Java do you return the first digit of an integer.?
i.e.
345
Returns an int of 3.
This way worked for me just fine, but it does involve converting from int to string and back to int.
Integer.parseInt(String.valueOf(x).substring(0,1));