How can I resolve period and comma as valid decimal point separators for floats?

I would like to allow both “123.45” and “123.45” as valid decimal inputs, but currently “123.45” leads to "The value '123.45' is not valid for Foo" .

+7
decimal model-binding asp.net-mvc-2
source share
1 answer

You must use globalization. Globalization allows you to configure numerical inputs for different locales. Take a look at the following article:

Globalization of ASP.NET MVC Client Validation
http://haacked.com/archive/2010/05/10/globalizing-mvc-validation.aspx

+4
source share

All Articles