I know that this is pretty old but i have an answer and maybe it will help somebody in the future. I used the DecimalFormat object to keep only the digits that were useful to me. Only one decimal was needed and it was always correct, even when the error appeared so this is OK for me.
The code is the following:
String pattern = "##0.0#";
DecimalFormatSymbols separator = new DecimalFormatSymbols();
separator.setDecimalSeparator('.');
DecimalFormat decimalFormatter = new DecimalFormat(pattern, separator);
int debt = 27003; //amount in cents;
System.out.println(decimalFormatter.format(((double) debt18 / 100)));