I have a localized ASP.NET Core Web Application: en-US and it-IT.
On en-US the decimal separator is dot, in it-IT the decimal separator is comma.
I have this ViewModel
public class MyViewModel
{
public int Id {get; set; }
// Omitted
public decimal? Amount{get; set;}
}
For the decimal field when I render the create/edit page on en-US the html textbox render
1000.00
If I POST the form, the operation complete without errors.
So far so good.
When I render the create/edit page on it-IT the html textbox render
1000,00 (notice the comma)
And IF I try to POST the form, (CLIENT) validation fail with
The field Amount must be a number.
I read about the IModelBinder but I understand is for mapping the viewModel when the form is posted on the server, on my case I'm blocked by the client-side validation.
The better is to use dot when en-US and comma when it-IT, but it's fine using only the dot