title: Converting a BigDecimal Number to the format of ###.#
body: <p>I am trying to make a number in a BigDecimal variable match the format of ###.# where no matter what number is passed it will come out as ###.#</p>
  
  <p>For example, if I was passed the number 1 in a BigDecimal variable the method would return 001.0</p>
  
  <p>If I was passed 11.1 as a BigDecimal variable the method would return 011.1</p>
  
  <p>I already have a bit of the code to make the decimal places match </p>
  
  <p><code>BigDecimal x = new BigDecimal(1); 
  DecimalFormat df = new DecimalFormat("#.0");
  String formatted = df.format(x);</code></p>
  
  <p>So this would return 1.0 however I cannot figure out how to make the leading zeros appear before converting back to BigDecimal.</p>
  
  <p>Can someone help me out or point me in the right direction? </p>
  
  <p>Thanks everyone</p>