hi all
please help me on how to create a currency string format based on culture.
ex : $ ###,###.00 for en-US
Generate currency string format dynamically
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hemant SrivastavaRank #581 · 4.2K reputationPosted Oct 8, 2013, 6:45 AM EDT
class Program
{
static void Main(string[] args)
{
double value = 12345.6789;
//For Current Culture
Console.WriteLine(value.ToString("C", CultureInfo.CurrentCulture));
//For Japan
Console.WriteLine(value.ToString("C3", CultureInfo.CreateSpecificCulture("ja-JP")));
//For Denmark
Console.WriteLine(value.ToString("C3",
CultureInfo.CreateSpecificCulture("da-DK")));
//For India
Console.WriteLine(value.ToString("C3",
CultureInfo.CreateSpecificCulture("en-IN")));
Console.Read();
}
}
Hemant SrivastavaRank #581 · 4.2K reputationPosted Oct 8, 2013, 6:48 AM EDT
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx#CFormatString
List of .Net Culture and Country Codes:
http://azuliadesigns.com/culture-codes/
Hope it would help.