title: BigDecimal round to 0 or 5
body: <p>I'm tinkering with <code>BigDecimal</code> and currency formatting in Android, and was wondering if it was possible to do the following using <code>BigDecimal</code>:</p>
  
  <p><strong>What I desire:</strong>  </p>
  
  <pre><code>  64.99 --&gt; 65.00 (Rounded Up)
    64.99 --&gt; 60.00 (Rounded Down)
    65.01 --&gt; 70.00 (Rounded Up)
    65.01 --&gt; 65.00 (Rounded Down)
  </code></pre>
  
  <p>At present, with my code below, I'm only able to round to zeros. For example:</p>
  
  <p><strong>What I get:</strong> </p>
  
  <pre><code>  64.99 --&gt; 70.00 (Rounded Up)
    64.99 --&gt; 60.00 (Rounded Down)
    65.01 --&gt; 70.00 (Rounded Up)
    65.01 --&gt; 60.00 (Rounded Down)
  </code></pre>
  
  <p>Is there a way using <code>BigDecimal</code> to achieve what I desire?            </p>
  
  <p>My code: </p>
  
  <pre><code>private static void printRoundedValues() {
      NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
      BigDecimal valueUp = new BigDecimal(64.50, new MathContext(1,RoundingMode.UP));
      BigDecimal valueDown = new BigDecimal(64.50, new MathContext(1,RoundingMode.DOWN)); 
  
      System.out.println("Value Up: " +  currencyFormat.format(valueUp));
      System.out.println("Value Down: " +  currencyFormat.format(valueDown));
  }
  </code></pre>