title: Format Float to n decimal places
body: <p>I need to format a float to "n"decimal places.</p>
  
  <p>was trying to BigDecimal, but the return value is not correct...</p>
  
  <pre><code>public static float Redondear(float pNumero, int pCantidadDecimales) {
      // the function is call with the values Redondear(625.3f, 2)
      BigDecimal value = new BigDecimal(pNumero);
      value = value.setScale(pCantidadDecimales, RoundingMode.HALF_EVEN); // here the value is correct (625.30)
      return value.floatValue(); // but here the values is 625.3
  }
  </code></pre>
  
  <p>I need to return a float value with the number of decimal places that I specify.</p>
  
  <p>I need <code>Float</code> value return not <code>Double</code></p>
  
  <p>.</p>