1
如何以美国文化格式显示货币价值,例如$ 5,123,456.55。我知道我可以使用ToString方法来做,但不知道如何?以美国文化格式显示货币值
如何以美国文化格式显示货币价值,例如$ 5,123,456.55。我知道我可以使用ToString方法来做,但不知道如何?以美国文化格式显示货币值
这是使用ToString方法
double cost=5123456.55;
Console.WriteLine(cost.ToString("C", new System.Globalization.CultureInfo("en-US")));
// The example displays the output: $5,123,456.55
另请参见溶液: