How to get a system character in a string

If I do this:

Console.Write("The sum is {0:c}", 12);

I am on a Swedish computer, so he will return: The amount is 12,00 kr

But is there an easy way to get only a currency symbol, without a number? Like this (obviously, this does not work, but just to show what I need):

 Console.Write("The symbol is {c}");

I would like this to output: Symbol: kr

+5
source share
3 answers

This code should return the currency symbol you are looking for.

System.Globalization.RegionInfo.CurrentRegion.CurrencySymbol

To get the ISO currency symbol

You can also use the following:
System.Globalization.RegionInfo.CurrentRegion.ISOCurrencySymbol
+10
source

You can use:

System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol;
+14
source

You can get this from NumberFormat in CurrentCulture:

Console.Write(System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol)
+3
source

All Articles