Richard Garside
Richard Garside

Reputation: 89180

Formatting currency for AED

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.

Upvotes: 1

Views: 2726

Answers (1)

Noon Silk
Noon Silk

Reputation: 55082

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;

Upvotes: 1

Related Questions