title: how to round a float number to one digit in android?
body: <p>I want to write a method to round the BMI of the user (float number)to one digit, is the  logic correct and how to write it in android Java?</p>
  
  <pre><code>private static final DecimalFormat oneDigit = new DecimalFormat("#,##0.0");
        public static float roundToOneDigit(float paramFloat)
    {  
           float   f = Float.valueOf(oneDigit.format(paramFloat)).floatValue();
  
            f=f;
           return f;
  
    }
  </code></pre>