title: asp.net mvc: allow multiple input-formats for a input field
body: <p>I want to allow multiple input-formats for a input field. In my case it is a Longitude field. In the DB I set it to decimal(18,10). It expects to recieve a comma-separated-value e.g. 16,2345678 but Google Maps or some Users are using a dot e.g. 16.2345678 
  I dont want to return an error but simply be glad and transform it to the expected db-format.</p>
  
  <p>I tried to do it in my MetaData Validation Class (using Entity Framework)</p>
  
  <pre><code>public partial class Job
  
      /*[Bind(Exclude = "ID")]*/
      public class JobMetaData
      {
          public object Longitude
          {
              get { return this.Longitude; }
              set { this.Longitude = value; /* Seems that this point isnt reached*/ }
          }
  </code></pre>
  
  <p>but unfortunatly the setter is not called and the ViewState.isValid returns simply false.</p>
  
  <pre><code>[HttpPost]
      public ActionResult Edit(Job model)
      {
  
          // parse the long-lat if needed here??
  
          try
          {
              if (!ModelState.IsValid)
              {
  </code></pre>
  
  <p>Where should I try to parse the value to allow both values (comma-separated and dot-separated) transform them and safe it.</p>
  
  <p>I have the same issue for another field: I would like the user to enter 4 or 4€, in case just delete the €-sign and save it as a number to db.</p>
  
  <p>Thanks for your help.</p>