title: cell in Excel "Number stored as text"
body: <p>I have a C# program that takes a text file of a legacy report and maps to an excel sheet.
  but for the transaction cells it is output as "Number stored as text" this does not allow 
  any formatting. We want to show 1,000.00 but it only as 1000.</p>
  
  <p>Is there a way I can get this formatting? those columns are Balance and Amount.
  here it is defined:</p>
  
  <pre><code>ndcRange = currentSheet.Cells[transactionRowNo + pageOffset, 13];
  ndcRange.NumberFormat = "@";
  ndcRange.Value2 = tr.Amount;
  
  ndcRange = currentSheet.Cells[transactionRowNo + pageOffset, 16];
  ndcRange.NumberFormat = "@";
  ndcRange.Value2 = tr.Balance;
  </code></pre>
  
  <p>Here is some code where some formatting is done:</p>
  
  <pre><code>string balance = transaction;
  
  if (lastSpaceIndex != -1)
  {
  
     balance = transaction.Substring(lastSpaceIndex, (transaction.Length)lastSpaceIndex);
  
  }
  
  transac.Balance = balance;
  transaction = transaction.Replace(balance, "");
  
  
  transaction = transaction.Trim();
  
  if (!string.IsNullOrWhiteSpace(transaction))
  {
      transac.Description = transaction;
  }
  patient.TransactionsList.Add(transac);
  </code></pre>