title: Formatting Floating point number in java upto 3 precison of decimal
body: <p>I have a variable type float.I  wanted to print it upto 3 precision of decimal including trailing zeros.</p>
  
  <p>Example : </p>
  
  <p>2.5 >> 2.500</p>
  
  <p>1.2 >> 1.200</p>
  
  <p>1.3782 >> 1.378</p>
  
  <p>2 >> 2.000</p>
  
  <p>I am trying  it by using</p>
  
  <pre><code>DecimalFormat _numberFormat= new DecimalFormat("#0.000");
  Float.parseFloat(_numberFormat.format(2.5))
  </code></pre>
  
  <p>But it is not converting 2.5 >> 2.500.</p>
  
  <p>Am I doing something wrong..</p>
  
  <p>Please help..</p>