title: C# + String Formatting
body: <p>I feel like I'm trying to do something simple but I am not getting the result I want. I want to display a basic number, that will always be positive. I do not want any leading zeros but I want thousands separators. For instance, for the following inputs, I want the following outputs:</p>
  
  <pre><code>3 -&gt; 3
  30 -&gt; 30
  300 -&gt; 300
  3000 -&gt; 3,000
  30000 -&gt; 30,000
  300000 -&gt; 300,000 
  </code></pre>
  
  <p>Currently, in an attempt to do this, I'm using the following formatting code:</p>
  
  <pre><code>  string text = "*Based on " + String.Format("{0:0,0}", total) + " entries";
  </code></pre>
  
  <p>Currently, the output looks like this:</p>
  
  <pre><code>3 -&gt; 03
  3000 -&gt; 3,000
  </code></pre>
  
  <p>You can see how a leading "0" is added when the thousands separator is not necessary. How do I properly format my numbers?</p>
  
  <p>Thank you</p>