[RESOLVED]Currency sysmbol in MVC 5 razor view?


I have datatype as like below in my model

[Display(Name = "Salary")]
public decimal? Salary { get; set; }

and in my web.config i have

<globalization culture="en-IN"/>

But still showing $ symbol.

Any more setting to be done?

Try this

<globalization uiculture = "en" culture="en-IN"/>


Try these codes:

[Display(Name = "Salary")]
[DisplayFormat(NullDisplayText = "n/a", ApplyFormatInEditMode = true, DataFormatString = "{0:c}")]
public decimal? Salary { get; set; }

And Web.config:

<globalization culture="auto" uiCulture="auto" />

This config is automatically based on your browser language setting, or on IE based on OS language setting,

Al these code has been used on my projects.

Have fun


But my culture depends on user selection from dropdown and i don’t want culture info to come from browser or web.config file.


You could change the culture in the action.

public ActionResult Index(string cultureinfo)
      CultureInfo culture = new CultureInfo(cultureinfo);
      Thread.CurrentThread.CurrentCulture = culture;
      Thread.CurrentThread.CurrentUICulture = culture;

Best Regards


Leave a Reply