Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
/MvcPublic archive
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Model binder doesn't validate decimals with thousands separator #5502

Closed
@frankabbruzzese

Description

@frankabbruzzese

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp