title: How to set up currency format for MVC EditorFor?
body: <p>I have to pages that need to show the item amount with currency format. The first one is where currency is entered and the second one where currency is displayed.</p>
  
  <p>I would like the EditorFor to show an R indicated Rands and then i would like the value to be decimal.</p>
  
  <p>Here is my EditorFor:</p>
  
  <pre><code>&lt;div class="editor-field"&gt;
      @Html.EditorFor(model =&gt; model.TransactionModel.Price)
  &lt;/div&gt;
  </code></pre>
  
  <p>I have tried many different ways and can't get any to work.</p>
  
  <p>With this example below it does not know what 'CurrencyPrice' is in the second line.</p>
  
  <pre><code>var CurrencyPrice = '@Model.TransactionModel.Price';
  document.getElementById('TransactionModel.Price').value = '@string.Format("{0:C}", CurrencyPrice)'; 
  </code></pre>
  
  <p>I have also tried these in my transactionModel:</p>
  
  <pre><code>//[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:c}")]
  //[UIHint("Currency")]
  //[DisplayFormat(DataFormatString = "{0:F2}", ApplyFormatInEditMode = true)]
  //[DataType(DataType.Currency)]
  public decimal Price { get; set; }
  </code></pre>
  
  <p>Could someone please tell me how i can get this right?</p>
  
  <p>Right now i will accept any working method.</p>