How to determine if a decimal/double is an integer?
<p>How do I tell if a decimal or double value is an integer?</p>

<p>For example:</p>

<pre><code>decimal d = 5.0; // Would be true
decimal f = 5.5; // Would be false
</code></pre>

<p>or </p>

<pre><code>double d = 5.0; // Would be true
double f = 5.5; // Would be false
</code></pre>

<p>The reason I would like to know this is so that I can determine programmatically if I want to output the value using <code>.ToString("N0")</code> or <code>.ToString("N2")</code>.  If there is no decimal point value, then I don't want to show that.</p>
