title: sprintf() to truncate and not round a float to x decimal places?
body: <p>When calculating a golf handicap differential you are supposed to truncate the answer to 1 decimal place without rounding.  No idea why but...</p>
  
  <p>I know how to do this using TRUNCATE() in mySQL </p>
  
  <pre><code> SELECT TRUNCATE( 2.365, 1 );
  // outputs 2.3
  </code></pre>
  
  <p>but I was wondering if sprintf() could do this?  The only way I know to work with decimal places in a float is ...</p>
  
  <pre><code>echo sprintf("%.1f", 2.365);
  // outputs 2.4
  </code></pre>