title: How to truncate a floating point number after a certain number of decimal places (no rounding)?
body: <p>I'm trying to print the number <code>684.545007</code> with 2 points precision <em>in the sense that the number be truncated (not rounded)</em> after <code>684.54</code>.</p>
  
  <p>When I use</p>
  
  <pre><code>var = 684.545007;
  printf("%.2f\n",var);
  </code></pre>
  
  <p>it outputs <code>684.55</code>, but what I'd like to get is <code>684.54</code>.</p>
  
  <p>Does anyone knows how can I correct this?</p>