如何获得货币FRACTION名称?

时间:2013-08-23 08:14:48

标签: c# asp.net asp.net-mvc cultureinfo

如果我了解文化,我可以知道货币名称和货币分数名称吗?

如果是“en-US”,则为dollar& cent

我试图避免在数据库中创建映射。如果asp.net可以提供这些信息,我会很高兴吗?可以吗?

PS:最终目标是 - 给定double像78.54,我想要seventy eight dollars and fifty four cents。我不想硬编码dollars& cents因为这应该是独立于文化的。

2 个答案:

答案 0 :(得分:2)

.Net缺少数字拼写和货币分数名称。

答案 1 :(得分:-2)

public static void Main() 
{
   RegionInfo ri = new RegionInfo("SE"); // Sweden

   Console.Clear();
   Console.WriteLine("Region English Name: . . . {0}", ri.EnglishName);
   Console.WriteLine("Native Name: . . . . . . . {0}", ri.NativeName);
   Console.WriteLine("Currency English Name: . . {0}", ri.CurrencyEnglishName);
   Console.WriteLine("Currency Native Name:. . . {0}", ri.CurrencyNativeName);
   Console.WriteLine("Geographical ID: . . . . . {0}", ri.GeoId);
}
/*
 This code example produces the following results:

 Region English Name: . . . Sweden
 Native Name: . . . . . . . Sverige
 Currency English Name: . . Swedish Krona
 Currency Native Name:. . . Svensk krona
 Geographical ID: . . . . . 221

*/

MSDN