code: private BigDecimal denominateAndRound(BigInteger satoshis, int minDecimals, List<Integer> fractionGroups) {
          int scale = scale(satoshis, minDecimals);
          BigDecimal denominatedUnitCount = new BigDecimal(satoshis).movePointLeft(offSatoshis(scale));
          int places = calculateFractionPlaces(denominatedUnitCount, scale, minDecimals, fractionGroups);
          return denominatedUnitCount.setScale(places, HALF_UP);
      }
docs: Takes a bitcoin monetary value that the client wants to format and returns the number of
  denominational units having the equal value, rounded to the appropriate number of
  decimal places.  Calls the scale() method of the subclass, which may have the
  side-effect of changing the currency symbol and code of the underlying `NumberFormat`
  object, therefore only invoke this from a synchronized method that resets the NumberFormat.