title: Decimal value in ASP.NET MVC and SQL Server
body: <p>I have a little problem with a decimal value inside the ASP.NET MVC application I'm writing. I have a NPoco binding to a database table and a <code>Price</code> entry that is defined as decimal(9,2). Here is the model entry that I use:</p>
  
  <pre><code>[Display(Name = "Price")]
  [Required]
  [DisplayFormat(DataFormatString = "{0:0,##}", ApplyFormatInEditMode = true)]
  public decimal Price { get; set; }
  </code></pre>
  
  <p>Next I have a knockout js model that binds all the parameters and works fine. Every other field is taken and bound correctly. For what concern the price I have this piece of html code:</p>
  
  <pre><code>&lt;input type="text" required data-bind="value: Price" class="form-control input-sm" id="priceID"/&gt;
  </code></pre>
  
  <p>Now if I insert a value with the comma everything works fine and the value is inserted inside the db correctly (e.g. 15,20) but if I use the dot a 0.00 value is inserted inside the database. The funny thing is when I reload the object for edit it the value of price is set and write with the dot inside the html page. </p>
  
  <p>So my question: is there is a method to accept both format (means with the dot and the comma)?</p>