title: Set the display precision of a float in Ruby
body: <p>Is it possible to set the display precision of a float in Ruby?</p>
  
  <p>Something like:</p>
  
  <pre><code>z = 1/3
  z.to_s    #=&gt; 0.33333333333333
  z.to_s(3) #=&gt; 0.333
  z.to_s(5) #=&gt; 0.33333
  </code></pre>
  
  <p>Or do I have to override the <code>to_s</code> method of <code>Float</code>?</p>