3 Digit currency code to currency symbol

前端 未结 9 1203
逝去的感伤
逝去的感伤 2020-12-04 10:19

In C# is it possible to get a currency symbol, like \'£\', from the 3 character currency code, in this case \'GBP\'?

Is this possible either in SQL Server or in C#?<

9条回答
  •  借酒劲吻你
    2020-12-04 10:54

    The RegionInfo class has a CurrencySymbol property, so it's doable in C#. You could perhaps use a C# stored procedure if you wanted to do it in Sql Server.

    RegionInfo regionInfo = new RegionInfo("GB");
    Console.WriteLine(regionInfo.CurrencySymbol); // £
    

    (You need to use the ISO country codes)

提交回复
热议问题