Currency Symbol for various languages in .net
Asked Answered
I

2

5

My application supports multi language including English ,Chinese, Hindi Language. I need to display the currency symbol in the textbox based on the culture selected. How can this be done?

Illumine answered 12/7, 2013 at 13:11 Comment(2)
Please read Using CulturesTempo
The proposed duplicate doesn't show how to get the currency symbol(e.g. $) for a given culture, the accepted answer only shows how to get the three-character symbol(e.g. USD) of the current culture/region.Hokusai
H
16

You can create a CultureInfo object via constructor or CreateSpecificCulture. Then you can use it's NumberFormat property and NumberFormatInfo.CurrencySymbol:

var culture = CultureInfo.CreateSpecificCulture("de-DE");    // german
string currencySymbol = culture.NumberFormat.CurrencySymbol; // €

culture = CultureInfo.CreateSpecificCulture("hi-IN");     // Hindi 
currencySymbol = culture.NumberFormat.CurrencySymbol;     //  ₹
Hokusai answered 12/7, 2013 at 13:15 Comment(0)
S
3

Using RegionInfo.CurrentRegion.ISOCurrencySymbol

NumberFormatInfo nfi = ci.NumberFormat;
nfi.CurrencySymbol

See NumberFormatInfo.CurrencySymbol

Stacistacia answered 12/7, 2013 at 13:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.