title: Formatting large numbers in C#
body: <p>I am using Unity to make an "Incremental Game" also known as an "Idle Game" and I am trying to format large numbers. For example, when <code>gold</code> gets to say 1000 or more, it will display as <code>Gold: 1k</code> instead of <code>Gold: 1000</code>.</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class Click : MonoBehaviour {
  
      public UnityEngine.UI.Text GoldDisplay;
      public UnityEngine.UI.Text GPC;
      public double gold = 0.0;
      public int gpc = 1;
  
      void Update(){
          GoldDisplay.text = "Gold: " +  gold.ToString ("#,#");
          //Following is attempt at changing 10,000,000 to 10.0M
          if (gold &gt;= 10000000) {
          GoldDisplay.text = "Gold: " + gold.ToString ("#,#M");
          }
          GPC.text = "GPC: " + gpc;
      }
  
      public void Clicked(){
              gold += gpc;
      }
  }
  </code></pre>
  
  <p>I have tried other examples while searching online, which is where <code>gold.ToString ("#,#");</code> came from, however none of them worked. </p>