Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency showing as dollars despite regional setting

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi,

I have an ASP.NET web app that displays currency values as British pounds on my local version but when run from a server it displays the values in dollars, even though the regional settings of the server are all set to United Kingdom defaults. Where can I configure this?

Thanks,

Tom

Tom
emo_big_smile.gif
 
Can you post a code snippet that illustrates the problem? Like, where you're formatting it for display?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
To format the currencies I'm using a variable holding a decimal value e.g. decMyValue and writing it to a string like this:

Code:
decMyValue.ToString("C2");

As I say, it works fine locally, but when uploaded to a particular server the currency symbol becomes a dollar sign instead of pound sign, so I presume the issue is a server setting. I know that in old ASP and VBScript there was a region statement you could write at the top of ASP pages. I'm fairly new to .NET so is there something similar?

Tom
emo_big_smile.gif
 
Try this:
Code:
using System.Globalization;

decMyValue.ToString("C2", CultureInfo.CurrentUICulture);
Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks for the tip, but it didn't work I'm afraid. Any other ideas?

Tom
emo_big_smile.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top