title: Adding comma separators to numbers, asp.net
body: <p>I'm trying to add comma separators to a number. I've tried the advice here: <a href="https://stackoverflow.com/questions/2545633/add-commas-using-string-format-for-number-and">add commas using String.Format for number and</a> and here: <a href="https://stackoverflow.com/questions/105770/net-string-format-to-add-commas-in-thousands-place-for-a-number">.NET String.Format() to add commas in thousands place for a number</a> but I can't get it to work - they just return the number without commas. The code I'm using is here:</p>
  
  <p><code>
   public static string addCommas(string cash) {
   return string.Format("{0:n0}", cash).ToString();<br>
   }
  </code></p>
  
  <p>Where am I going wrong?</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>Update: Hi all, thanks for your help, but all of those methods are returning the same error: "error CS1502: The best overloaded method match for 'BishopFlemingFunctions.addCommas(int)' has some invalid arguments" (or variations therof depending on what number type I'm using.) Any ideas? </p>