title: Why do programming languages round down until .6?
body: <p>If you put a decimal in a format where has to be rounded to the nearest 10th, and it is: 1.55, it'll round to 1.5. 1.56 will then round to 1.6. In school I recall learning that you round up when you reach five, and down if it's 4 or below. Why is it different in Python, et al.</p>
  
  <p>Here's a code example for Python 2.6x (whatever the latest version is)</p>
  
  <pre><code>'{0:01.2f}'.format(5.555)  # This will return '5.55'
  </code></pre>
  
  <p>After trying some of the examples provided, I realized something even more confusing:</p>
  
  <pre><code>'{0:01.1f}'.format(5.55)  # This will return '5.5'
  # But then
  '{0:01.1f}'.format(1.55)  # This will return '1.6'
  </code></pre>
  
  <p>Why the difference when using 1.55 vs 5.55. Both are typed as literals (so floats)</p>