Unable to change currency RRS feed

  • Question

  • User521171331 posted


    I have applied this code in my web.config, 

            <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
            See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
            more information on using ASP.NET authorization securing ELMAH.
          <globalization culture="ms-MY" uiCulture="ms-MY" />      

    I want it to be

    Price: RM22.50

    But, in my aspx page, it will show s

    Price: £22.50

    My aspx page code is

       <span><b>Price: </b><%#:String.Format("{0:c}", Item.UnitPrice)%></span>

    Can someone help? Thanks :)

    Sunday, April 9, 2017 3:35 AM

All replies

  • User-1509636757 posted

    I reckon Culture is being overridden somewhere in your code, I suggest you debug and check  what value you are receiving for CultureInfo.CurrentCulture.Name on the page where you are seeing the issue.

    Sunday, April 9, 2017 5:37 AM
  • User521171331 posted

    How do I debug it? Since, it is just a "C" string?

    By the way my example is from https://code.msdn.microsoft.com/Getting-Started-with-221c01f5 or https://docs.microsoft.com/en-us/aspnet/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/introduction-and-overview

    Sunday, April 9, 2017 2:58 PM
  • User-1509636757 posted

    I mean to say is, put a breakpoint on Page_Load event for that page and see what value you receive as current culture.

    Monday, April 10, 2017 2:41 AM