none
Decimal validation ignores CurrentCulture settings. Comma vs Point RRS feed

  • Question

  • I am using a decimal value in my Model. When I insert a number "2", it is displayed correctly as "2,00".

    When I try to edit the record, the Model Validation tells me "2,00" is not a valid number. So I try "2.00" or "2" (with a point) and that works.

    In my Culture, the precision of a decimal is noted with a comma and not with a point.

    Why does the Validator for Decimal ignore my CurrentCulture? The decimal gets displayed correctly though...

     

    I tried this url: http://haacked.com/archive/2010/05/10/globalizing-mvc-validation.aspx

    But it did not help.

    I also added this globalization tag to my web.config. It did not help either 

    <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="nl-BE" uiCulture="nl-BE" />

     

    Any solutions?


    ketelsb
    • Edited by ketelsb Tuesday, October 25, 2011 5:23 PM
    Tuesday, October 25, 2011 5:02 PM

Answers

All replies