Parse decimal in view model

Viewed 5700

I'm developing a site in ASP.NET MVC 3.

Property

[DisplayName("Cost"), DisplayFormat(DataFormatString = "{0:F2}", ApplyFormatInEditMode = true)]
public decimal Cost { get; set; }

View

@Html.EditorFor(x => x.Cost)

The view renders Cost as 1000,00 (for example). The problem is, validation demands a point instead of a comma. How can I output 1000.00 instead of 1000,00? Or reverse the validation to accept the comma instead of a point?

Edit. I've set globalization in my web.config to sv-SE (Sweden).

3 Answers
Related