Is there a simple way I can select a digit from a double and convert it to int?
I created this statement
which works fine, except that when the double is a different length than expected it can select the decimal point and an exception occurs when converting it to an int.
I created this statement
Code:
Integer.parseInt((Double.toString(priceperlitre)).substring(0, 1))
Last edited: