title: CURRENCY - Round double value ONLY if it has more than 2 decimal places
body: <p>I'm trying to split a bill and need to calculate how much each person would owe if the bill was split in even amounts. I know one amount will be different than the rest to account for the lost cents.</p>
  
  <p>Assume 3 people try to split a bill for 200. 200 / 3 is 66.6666666667. What I planned on doing was charging the 2 first people 66.67 and the last gets lucky with the 66.66 bill.</p>
  
  <p>At the minute, I have this so far: </p>
  
  <pre><code>private String calculateAmountToPay(String noOfParticipants, String owed) {
      double amountOwed = Double.parseDouble(owed);
      int noOfMembers = Integer.parseInt(noOfParticipants);
      DecimalFormat amountFormat = new DecimalFormat("#.##");
      amountFormat.setRoundingMode(RoundingMode.CEILING);
      return amountFormat.format((amountOwed/(double)noOfMembers) / 100);
    }
  </code></pre>
  
  <p>But this always will return 66.67. Is there a way that I can get it to only round up if there is a number greater than 2 decimal places, if not, it stays at 66.66 for example?</p>
  
  <p>Maybe I'm approaching this the wrong way. I know currency can be finicky to deal with.</p>