Format decimal with fewest possible digits after decimal separator
<p>I am storing a variety of different sizes as a decimal in SQL server, such as:</p>

<blockquote>
  <p>10oz, 3.3oz, 100ml, 1.75litres</p>
</blockquote>

<p>When I pull this number out as a decimal and do ToString() I end up with too many extra digits such as</p>

<blockquote>
  <p>10.000, 3.300, 100.00, 1.750 </p>
</blockquote>

<p>What I want is basically this :</p>

<pre><code>decimal.Parse("1.7500").ToString().TrimEnd('0', '.')
</code></pre>

<p>to get me <code>1.75</code> or <code>10</code> </p>

<p>I cannot seem to figure out the format string for this.</p>

<p>In Visual Studio debugger if I do <code>decimal.Parse("1.7500")</code> it will show it to me as <code>1.75</code> but when I do <code>ToString()</code> it becomes <code>1.7500</code>.</p>

<p><a href="http://stackoverflow.com/a/7899828/16940">Decimal.Round(...)</a> is no good because the format is not fixed.</p>
