views:

75

answers:

1

Hi,

I'm currently doing a project for a client in Dubai, where the currency is AED. Throughout the project I used {0:c} assuming that setting the local in web-config would sort me out.

I set the culture in web.config using:

<globalization culture="ar-AE" />

This used arabic symbols for the currency, which I assumed the client would want (turns out I assumed a bit too much). They actually wanted the currency to look like:

AED 50.00

I'm not sure if this is the standard format or not. Is there a way in web.config to make it use this format. I ended up hard coding all the currencies, but I'm sure there must be a better way.

+1  A: 

Assuming the current culture/region is set, this is avilable in the following:

string symbol = System.Globalization.RegionInfo.CurrentRegion.CurrencySymbol;

string symbol = System.Globalization.RegionInfo.CurrentRegion.ISOCurrencySymbol;
Noon Silk
The culture region is set, but I get an arabic symbol for the currency, when the client wants it to say AED 50.00. I don't know enough about AED to say what the standard should be.
Richard
@Richard Sorry, I meant `.ISOCurrencySymbol` should get the 3 letters "AED".
Noon Silk
That's ace. Is there a way to tell it to use the ISOCurrencySymbol format for all currencies in web.config so I can continue to use just {0:c} in things like bound columns.
Richard
@Richard Yes I'd be interested to know if you could do that (I had a quick look myself and I couldn't see how). I think you can write your own custom format provider to do it, but not too sure.
Noon Silk