title: Avoid trailing zeroes in printf()
body: <p>I keep stumbling on the format specifiers for the printf() family of functions.  What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point.  If I use:</p>
  
  <pre><code>printf("%1.3f", 359.01335);
  printf("%1.3f", 359.00999);
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>359.013
  359.010
  </code></pre>
  
  <p>Instead of the desired</p>
  
  <pre><code>359.013
  359.01
  </code></pre>
  
  <p>Can anybody help me?</p>