Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Currency settings in Azure

Tags:

azure

I have a small ASP.NET MVC site that displays salary details for employees.

<td align="right">@String.Format("{0:c}", Model.Salary)</td>

On my local machine this displays fine e.g. £66,000, however when uploaded to Azure it is displaying with a dollar e.g. $66,000.

When setting up I chose western Europe as my location but I obviously need to do something else tfor this to display in £s. Any ideas?

like image 515
Martin McMahon Avatar asked Nov 30 '22 01:11

Martin McMahon


1 Answers

You need to set specific culture at application level in web.config as below

<configuration>
    <system.web>
        <globalization uiCulture="en-GB" culture="en-GB" />
    </system.web>
</configuration>

Alternatively you can also set below to Application_PreRequestHandlerExecute() in global.asax file

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
like image 186
Arun Rana Avatar answered Dec 06 '22 12:12

Arun Rana