title: How do I set a Json array as Money?
body: <p>I need to change this 197000.99996 to this $197,001</p>
  
  <p>I know I need to use {0:C}</p>
  
  <p>but I don't know how to do this when I am using an array, below is the code</p>
  
  <pre><code>public ActionResult getAjaxSCs(string PA = null, float AmountList = 0)
          {
  
              if (PA != null)
              {
  
                  var SCList = from x in db.NDE_Actuals_Web                             
                               where x.PA == PA                             
                               group x by new { x.SPEND_CATEGORY, x.ACCOUNTING_PERIOD} into scgroup                             
                               select new { spend_category = scgroup.Key.SPEND_CATEGORY, accounting_period = scgroup.Key.ACCOUNTING_PERIOD, amount = scgroup.Sum(x=&gt; x.Amount)};
  
                  SCList = SCList.OrderBy(x =&gt; x.spend_category);
  
                  Dictionary&lt;string, double[]&gt; SCRow = new Dictionary&lt;string, double[]&gt;();
                  double[] SCContent = new double[12];
                  string lastSpendCategory = null;
                  foreach (var item in SCList)
                  {
                      if (lastSpendCategory != item.spend_category)
                      {
                          SCContent = new double[12];
                      }
  
                      int accounting_period = int.Parse(item.accounting_period) -1;
                      SCContent[accounting_period] = (double)item.amount;
                      SCRow[item.spend_category] = SCContent;
                      lastSpendCategory = item.spend_category;
                  }
  
                  return Json(SCRow, JsonRequestBehavior.AllowGet);
  
              }
              return View();
          }
  </code></pre>
  
  <p>I need to convert SCRow so it will send the value in money format and round the decimals off. Thanks for your help!</p>