如果我了解文化,我可以知道货币名称和货币分数名称吗?
如果是“en-US”,则为dollar
& cent
。
我试图避免在数据库中创建映射。如果asp.net可以提供这些信息,我会很高兴吗?可以吗?
PS:最终目标是 - 给定double
像78.54,我想要seventy eight dollars and fifty four cents
。我不想硬编码dollars
& cents
因为这应该是独立于文化的。
答案 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
*/