final int satoshis = (int) (absValue % units); if (isShiftPossible(units, satoshis, 100)) { formatedValue = String.format(Locale.US, "%d.%02d", coins, getShiftedCents(units, satoshis, 100)); } else if (isShiftPossible(units, satoshis, 10000)) { formatedValue = String.format(Locale.US, "%d.%04d", coins, getShiftedCents(units, satoshis, 10000)); } else if (isShiftPossible(units, satoshis, 1000000)) { formatedValue = String.format(Locale.US, "%d.%06d", coins, getShiftedCents(units, satoshis, 1000000));