formatting double precision values in C#
<p>Say I have a <code>double</code> variable initialized as </p>

<pre><code>double dValue  = 5.156365
</code></pre>

<p>I would like to show this in a textbox as 5.16 i.e only two decimal places.</p>

<p>How should I format? </p>

<p>Is <code>textbox.Text = dValue.ToString("F2", Culture.....)</code> correct? When I tried it did give me the correct result.  However, if <code>dValue = 5</code> then I would like only 5 to be shown and not 5.00.</p>

<p>How could I achieve this in C#?</p>
