title: Rounding Half Up with Decimal Format in Android
body: <p>I want to set the Rounding Mode to HALF_UP on my DecimalFormat, but eclipse is telling me that setRoundingMode() is not available on the DecimalFormat class. My project properties (and the overall Eclipse properties) are using the 1.6 compiler. The developer.android.com site says that I can use either Java 5 or 6 so I'm not sure what the problem is.</p>
  
  <p><pre><code>import java.math.RoundingMode;
  import java.text.DecimalFormat;</p>
  
  <p>completedValueFormatter = NumberFormat.getNumberInstance();
  DecimalFormat completedDecimalFormat = (DecimalFormat)completedValueFormatter;
  completedDecimalFormat.setRoundingMode(RoundingMode.HALF_UP);</pre></code></p>
  
  <p>I've also tried using the android tools to generate an ant-based project, tried this code in the project and also got the same compile error. So it doesn't appear to be related to Eclipse. It seems related to the Android API.</p>
  
  <p>Any suggestions?</p>