You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
While client side validation hamdles properly decimals with thousands separators, model binder consider them invalid. So client validation submit the form, but then one gets a server side error.
This is an old problem (Mvc5, Mvc4...) and it is due to the ModelBinder using TypeDescriptor.GetConverter(type) to get a converter for strings to decimals. So the point is the "strange" behavior of the decimal TypeConverter.
Now it seems that the dotnet core team decided not to fix this behavior (I understand that this might cause unacceptable compatibilty issues).
So maybe the best place to fix this issue is the SimpleTypeModelBinder class, by using a different conversion method just for numbers.
It is worth pointing out that not only the jquery validation plugin, but substantially all client side globalization packages(like for instance both old and new version of the Globalize package) accept thousand separators when parsing/recognizing well formed numbers.