hi all
please help me on how to create a currency string format based on culture.
ex : $ ###,###.00 for en-US
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Oct 8, 2013, 10:48 AM
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.
Hemant SrivastavaPosted Oct 8, 2013, 10:45 AM
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();
}
}