ASP.NET - Display in Local Currency

We have an ASP.NET web portal (VB language) that we intend to use in the United States and the United Kingdom.

Around all the currency fields, we are using <asp:BoundField DataField="DocAmount" HeaderText="Amount" DataFormatString="{0:c2}"/> to control formatting of the value. On the developer's machine, if we flip the Regional Settings from United States to United Kingdom, the display of the currency fields changes as expected.

We recently deployed this project to a production machine in the UK and it shows United States currency format, not UK currency format. We have verified on that server that the Regional Settings are set to United Kingdom.

We noted that the currency format doesn't change on the developer's machine unless we do a rebuild AFTER we changed his regional settings.

Is there some setting on the UK production server that we might be missing?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I've seen this problem on some of the servers I've deployed to, I don't believe it's related to build time parameters as my machine is configured to UK regional settings as are all the servers we work with.

While doing some research around the problem I read somewhere that if the server is not initially configured to UK settings, but changed after installation then the NetworkService account that runs under is not changed, which can lead to the problems you have encountered.

Fixing it is relatively simple, if you are deploying to a separate server and are happy for all users to have UK settings then add a globalization element to your web.config (under system.web):

<globalization culture="en-GB" uiCulture="en-GB" />

Alternatively you can detect the users culture from their browser settings and configure based on this, as described here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.