title: MVC/JQuery validation does not accept comma as decimal separator
body: <p><strong>Update 07.01.2018</strong></p>
  
  <p>Even though it was suggested, that this is rather a jQuery problem than an MS ASP MVC problem, I think it is an MVC Problem. I've created the whole app in asp.net core 2.0 MVC and the error persist. What links it to MVC for me, is the fact that I can solve the date validation problem by adding the line <code>[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]</code> to the model. Hence, MVC has an influence on the validation. So I would assume there is some way in MVC to fix this (See this <a href="https://stackoverflow.com/questions/48041115/mvc-editorfor-date-not-showing-value">post</a>). Please post answers for asp.net core 2.0.</p>
  
  <p><strong>Original Post</strong></p>
  
  <p>In an MVC5 page I render a <code>Double</code> Property in a Textbox. When the page is loaded, the value is shown with a "," as decimal separator, which is correct, as the page runs on an German System. If I want to save the form, I get an validation error. How can this be solved? I know that there are some questions on the topic, but as far as i can see, most of them are outdated... I'm still struggling, that there is no setting or anything built-in that allows users from different countries to work with MVC apps.</p>
  
  <p>Model:</p>
  
  <pre><code>[DisplayFormat(DataFormatString = "{0:n2}", ApplyFormatInEditMode = true)]
  public Double Gewicht
  {
      get { return gewicht; }
      set { gewicht = value; OnPropertyChanged(new PropertyChangedEventArgs("Gewicht")); }
  }
  </code></pre>
  
  <p>CSHTML:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.Gewicht, htmlAttributes: new { @class = "control-label col-md-3" })
      &lt;div class="col-md-8"&gt;
          @Html.EditorFor(model =&gt; model.Gewicht, new { htmlAttributes = new { @class = "form-control col-md-1" } })
          @Html.ValidationMessageFor(model =&gt; model.Gewicht, "", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Web.config</p>
  
  <pre><code>&lt;globalization uiCulture="de-DE" culture="de-DE" /&gt;
  </code></pre>
  
  <p>Box after its loaded --> Value loaded with a comma as decimal separator
  <a href="https://i.stack.imgur.com/E6ZB3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/E6ZB3.png" alt="enter image description here"></a></p>
  
  <p>Box after submit button is clicked --> Validation error for the same value</p>
  
  <p><a href="https://i.stack.imgur.com/5GTXw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5GTXw.png" alt="enter image description here"></a></p>
  
  <p>Box after comma is changed to point --> No validation error
  <a href="https://i.stack.imgur.com/9Wp7Y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9Wp7Y.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 05.01.2018</strong></p>
  
  <p>I've tried the solution shown <a href="https://stackoverflow.com/questions/1560796/set-culture-in-an-asp-net-mvc-app">here</a> which unfortunately doesn't work for me. However, I also discovered, that the values not only get not acceptet, but are also changed to numbers where group separator and decimal separator are mixed up (see picture). What happens is, that the value of 22 gets changed to 22.5 and stored in the database. The result beeing, that a value of 2,250.00 is stored to the database. </p>
  
  <p><a href="https://i.stack.imgur.com/dJGfF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dJGfF.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 07.01.2018</strong></p>
  
  <p>What is also interesting, is the fact that the date fields accept the german format perfectly fine.</p>
  
  <p>Property</p>
  
  <pre><code>private DateTime? inbetriebnahmedatum;
  
  [DataType(DataType.Date)]
  [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
  public DateTime? Inbetriebnahmedatum
  {
      get { return inbetriebnahmedatum; }
      set { inbetriebnahmedatum = value; OnPropertyChanged(new PropertyChangedEventArgs("Inbetriebnahmedatum")); }
  }
  </code></pre>
  
  <p>The value shown below is accepted and processed without any errors. 
  <a href="https://i.stack.imgur.com/1AATD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1AATD.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 07.01.2018 - 2</strong></p>
  
  <p>If I change the line in edit.cshtml from </p>
  
  <pre><code>&lt;input asp-for="Gewicht" class="form-control" /&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;input name="Gewicht" id="Gewicht" type="number" class="form-control" value="@Model.Gewicht"/&gt;
  </code></pre>
  
  <p>The form can be submitted with the value "23,7" without validation errors. In the controller, the bound model property shows a value of "237", where as the <code>IFormCollection</code> shows a value of "23.7". This would suggest a problem with the model binder.</p>