How to format a Rational number as a decimal?
<p>Given an arbitrary large (or small) <code>Rational</code> number that has a finite decimal representation, e.g.:</p>

<pre><code>r = Rational(1, 2**15)
#=&gt; (1/32768)
</code></pre>

<p>How can I get its full decimal value as a string?</p>

<p>The expected output for the above number is:</p>

<pre><code>"0.000030517578125"
</code></pre>

<p><code>to_f</code> apparently doesn't work:</p>

<pre><code>r.to_f
#=&gt; 3.0517578125e-05
</code></pre>

<p>And <code>sprintf</code> requires me to specify the number of digits:</p>

<pre><code>sprintf('%.30f', r)
#=&gt; "0.000030517578125000000000000000"
</code></pre>