title: Format a number with PHP to always have 2 digits before decimal
body: <p>I'm trying to format a number in PHP to always have at least 2 places before the decimal and can't seem to figure it out no matter what I google/try. I'd prefer to only do this if there's not a whole number before the decimal.</p>
  
  <p>This would be the ideal desired output, as I do not know the numbers before hand, it changes per page.</p>
  
  <pre><code>0.59 becomes 00.59
  1.00 stays 1.00
  0.43 becomes 00.43
  14.56 stays 14.56
  </code></pre>
  
  <p>Any ideas?</p>