title: DataFormatString: the field must be a number
body: <p>I have this model: </p>
  
  <pre><code>[DisplayFormat(DataFormatString = "{0:c}", ApplyFormatInEditMode = true)]
  public decimal SpotPrice { get; set; }
  </code></pre>
  
  <p>In my details view it displays prices as "25,00". When I try to edit the price, the field is pre-filled with the database entry "25,00". When I hit save immediately I get this error: <code>"The field SpotPrice must be a number."</code></p>
  
  <p>With the suggestions given in this <a href="https://stackoverflow.com/questions/11985545/asp-net-mvc4-tutorial-scaffolding-validation-and-display-use-several-different">question</a> I have set my global culture in Web.Config: </p>
  
  <pre><code>&lt;system.web&gt;
  &lt;globalization culture="nl-NL"/&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>I have also tried many different DataFormatStrings, but none of them allow me to get rid of that error message.</p>
  
  <p>I use SQL Server to store the prices.</p>
  
  <p>Edit: updated the question:
  What can I do to make this price field validate properly?</p>
  
  <p>Edit: Here's my Edit method, which I use to save the new price:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Edit([Bind(Include = "CampingSpotId,SpotName,FieldName,Surface,Wifi,Water,Sewer,Reserved,Booked,SpotPrice,Type")] CampingSpot campingSpot)
  {
      if (ModelState.IsValid)
      {
          _campingspotrepository.SetModified(campingSpot);
          return RedirectToAction("Index");
      }
      return View(campingSpot);
  }
  </code></pre>
  
  <p>SetModified method does this:</p>
  
  <pre><code>public void SetModified(CampingSpot campingSpot)
  {
      db.Entry(campingSpot).State = EntityState.Modified;
      db.SaveChanges();
  }
  </code></pre>