title: Alternative way to format number with Comma
body: <p>Is there a better way to write this function that will add a comma to a number?</p>
  
  <pre><code>private static string FormatNumber(decimal? number)
  {
      if (!number.HasValue)
      {
          return string.Empty;
      }
      // use the different formatter for long numbers
      return number &gt; 99999 ? $"{number.Value:#,###.##}" : $"{number.Value:G29}";
   }
  </code></pre>